/* Global Styles */
body {
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.form-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #3b82f6;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.required-star {
    color: #ef4444;
    margin-left: 2px;
}

/* Photo Upload */
.photo-upload-container {
    width: 117px;
    height: 171px;
    border: 3px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
    overflow: hidden;
    position: relative;
}

.photo-upload-container:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.photo-size-info {
    font-size: 0.75rem;
    color: #64748b;
    text-align: center;
    margin-top: 8px;
}

/* Buttons */
.submit-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 16px 48px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.admin-btn {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    padding: 12px 32px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.admin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.back-btn {
    background: #3b82f6;
    color: white;
    padding: 12px 32px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.back-btn:hover {
    background: #2563eb;
}

/* Header Banner */
.header-banner {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    padding: 32px;
    border-radius: 20px;
    margin-bottom: 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Print Styles */
.print-page {
    display: none;
}

.print-page.show {
    display: block;
}

.print-header {
    text-align: center;
    border-bottom: 2px solid #333;
    padding-bottom: 12px;
    margin-bottom: 20px;
    font-family: 'Times New Roman', serif;
}

.header-line {
    font-size: 0.9rem;
    font-weight: 600;
    color: #000;
    line-height: 1.3;
}

.header-main {
    font-size: 1.1rem;
    font-weight: bold;
    color: #000;
}

.registration-number {
    text-align: center;
    padding: 16px 0;
    font-size: 1.5rem;
    font-weight: bold;
    color: #1e40af;
    border: 3px solid #1e40af;
    border-radius: 8px;
    background: #eff6ff;
    margin-bottom: 24px;
}

.print-form {
    font-family: 'Times New Roman', serif;
    font-size: 0.95rem;
    line-height: 1.6;
}

.print-section {
    margin-bottom: 20px;
    border: 1px solid #ccc;
    padding: 12px;
}

.print-section-title {
    font-weight: bold;
    background: #e2e8f0;
    padding: 8px 12px;
    margin: -12px -12px 12px -12px;
    font-size: 1rem;
}

.print-row {
    display: flex;
    margin-bottom: 8px;
}

.print-col {
    flex: 1;
    display: flex;
    gap: 12px;
}

.print-label {
    font-weight: bold;
    min-width: 150px;
}

.print-value {
    flex: 1;
    word-break: break-word;
}

.print-photo {
    width: 117px;
    height: 171px;
    border: 2px solid #333;
    margin: 0 auto;
}

/* Admin Panel Styles */
.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e2e8f0;
}

.admin-tab {
    padding: 12px 24px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.3s;
    text-decoration: none;
}

.admin-tab.active {
    background: #3b82f6;
    color: white;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

.registrations-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.registrations-table th {
    background: #f3f4f6;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e2e8f0;
}

.registrations-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.registrations-table tr:hover {
    background: #f9fafb;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-verified {
    background: #d1fae5;
    color: #065f46;
}

.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.action-btns {
    display: flex;
    gap: 8px;
}

.action-btns button {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-view {
    background: #3b82f6;
    color: white;
}

.btn-view:hover {
    background: #2563eb;
}

.btn-approve {
    background: #10b981;
    color: white;
}

.btn-approve:hover {
    background: #059669;
}

.btn-reject {
    background: #ef4444;
    color: white;
}

.btn-reject:hover {
    background: #dc2626;
}

/* Filter */
.filter-group {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.filter-select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
}

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #ef4444;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid #10b981;
}

/* Print Media Queries */
@media print {
    body {
        background: white;
    }
    .header-banner,
    .submit-btn,
    .admin-btn,
    #formContainer,
    .back-btn {
        display: none !important;
    }
    .print-page {
        display: block !important;
    }
    .print-page.show {
        display: block !important;
    }
    .print-header {
        page-break-after: avoid;
    }
    .print-section {
        page-break-inside: avoid;
    }
    .print-form {
        color: #000;
    }
}

/* ========================================
   FIX: CROPPER MODAL TIDAK OVERFLOW
   Modal maksimal 1/3 lebar layar, scrollable
   ======================================== */
#cropperModal .bg-white.rounded-lg.shadow-2xl {
    max-width: 95vw !important; /* Mobile: 95% lebar layar */
    max-height: 90vh !important; /* Maksimal 90% tinggi layar */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 1rem !important;
}

/* Desktop: Batasi lebar maksimal 1/3 layar */
@media (min-width: 1024px) {
    #cropperModal .bg-white.rounded-lg.shadow-2xl {
        max-width: 33.333333vw !important; /* TEPAT 1/3 lebar layar */
        margin: 2rem auto !important;
    }
}

/* Container gambar: scrollable jika gambar terlalu besar */
#cropperModal .p-4.bg-gray-50 {
    flex: 1;
    overflow: auto; /* Aktifkan scroll */
    padding: 0 !important;
    background: #f8fafc !important;
    max-height: 65vh; /* Maksimal 65% tinggi viewport */
}

/* Wrapper gambar cropper */
#cropperModal .overflow-hidden.rounded-lg.bg-white.border {
    border-radius: 0 !important;
    border: none !important;
    max-height: 100%;
    overflow: auto; /* Scroll jika gambar besar */
    margin: 0;
    background: white;
    box-shadow: inset 0 0 0 1px #e2e8f0;
}

#cropperImage {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    min-height: 300px; /* Minimum height untuk area crop */
}

/* Footer tetap di bawah, tidak ikut scroll */
#cropperModal .p-4.border-t.border-gray-200.bg-gray-50 {
    flex-shrink: 0;
    background: white !important;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
    z-index: 20;
    position: sticky;
    bottom: 0;
    padding: 1rem 1.5rem !important;
}

/* Tombol di footer */
#cropperModal .flex.gap-3 {
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Loading overlay */
#cropLoading {
    z-index: 10000 !important;
}

/* Animasi loading */
@keyframes spin {
    to { transform: rotate(360deg); }
}
.animate-spin {
    animation: spin 1s linear infinite;
}

/* Responsive untuk mobile */
@media (max-width: 768px) {
    #cropperModal .bg-white.rounded-lg.shadow-2xl {
        margin: 0.5rem !important;
        max-height: 85vh !important;
    }
    
    #cropperModal .p-4.bg-gray-50 {
        max-height: 55vh;
    }
    
    #cropperModal .text-xl {
        font-size: 1.1rem !important;
    }
    
    #cropperModal .px-5.py-2\.5 {
        padding: 0.5rem 1rem !important;
        font-size: 0.85rem !important;
    }
}