/* 
 * Speaker Registration Form Stylesheet
 * Created with premium modern web aesthetics: glassmorphism, responsive grids, custom file drop zones, and automated dark mode.
 */

:root {
    /* Color Palette */
    --primary-grad-start: #3b82f6; /* Sapphire Blue */
    --primary-grad-end: #8b5cf6;   /* Royal Amethyst */
    --accent-color: #ec4899;       /* Pink Rose */
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --border-color: #e2e8f0;
    --border-focus: #3b82f6;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    
    /* Typography & Shadows */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
    --border-radius: 12px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* Dark Mode Overrides (Automatic system detection) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-glass: rgba(15, 23, 42, 0.75);
        --border-color: #334155;
        --border-focus: #60a5fa;
        
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --text-muted: #64748b;
        
        --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    }
}

/* Layout Container */
.speaker-reg-container {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    max-width: 900px;
    margin: 30px auto;
    position: relative;
    box-sizing: border-box;
    transition: background var(--transition-normal), border var(--transition-normal);
}

.speaker-reg-container * {
    box-sizing: border-box;
}

/* Loading Spinner Overlay */
.speaker-reg-spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.speaker-reg-loading .speaker-reg-spinner-overlay {
    opacity: 1;
    pointer-events: all;
}

.speaker-reg-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-grad-start);
    border-radius: 50%;
    animation: speaker-spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes speaker-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header */
.speaker-reg-header {
    text-align: center;
    margin-bottom: 30px;
}

.speaker-reg-header h2 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px 0;
    background: linear-gradient(135deg, var(--primary-grad-start), var(--primary-grad-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.speaker-reg-header p {
    color: var(--text-secondary);
    font-size: 15px;
    margin: 0;
}

/* Stepper Progress Tracker */
.speaker-reg-steps {
    display: flex;
    justify-content: space-between;
    list-style: none;
    padding: 0;
    margin: 0 0 40px 0;
    position: relative;
}

.speaker-reg-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
}

.step-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    flex: 1;
    text-align: center;
}

.step-num {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    font-size: 15px;
    transition: all var(--transition-normal);
}

.step-label {
    margin-top: 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    max-width: 100px;
    line-height: 1.3;
    transition: color var(--transition-normal);
}

/* Active and Complete Stepper States */
.step-node.active .step-num {
    background: linear-gradient(135deg, var(--primary-grad-start), var(--primary-grad-end));
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.step-node.active .step-label {
    color: var(--text-primary);
    font-weight: 600;
}

.step-node.completed .step-num {
    background: var(--success);
    border-color: var(--success);
    color: #ffffff;
}

.step-node.completed .step-label {
    color: var(--success);
}

/* Panel Animations */
.form-step-panel {
    display: none;
    animation: panel-fade-in 0.4s ease forwards;
}

.form-step-panel.active {
    display: block;
}

@keyframes panel-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

.step-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin: -10px 0 20px 0;
}

/* Responsive Grid System */
.form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-12 { grid-column: span 12; }

@media (max-width: 768px) {
    .col-2, .col-3, .col-4, .col-6 {
        grid-column: span 12;
    }
    .speaker-reg-steps {
        overflow-x: auto;
        padding-bottom: 10px;
    }
    .step-node {
        min-width: 80px;
    }
}

/* Form Labels and Controls */
.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: inline-block;
}

.form-group label .required {
    color: var(--error);
}

/* Form Inputs */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    font-family: var(--font-body);
    font-size: 15px;
    padding: 10px 14px;
    min-height: 46px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-fast);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Interactive Input States */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Native `:user-valid` and `:user-invalid` Styles */
.form-group input:not(:placeholder-shown):user-invalid,
.form-group select:user-invalid,
.form-group textarea:user-invalid {
    border-color: var(--error);
    background-color: rgba(239, 68, 68, 0.02);
}

/* Custom Checkboxes */
.checkbox-container {
    position: relative;
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    user-select: none;
}

.custom-checkbox-box {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    margin-right: 10px;
    display: inline-block;
    position: relative;
    transition: all var(--transition-fast);
    background: var(--bg-primary);
}

input[type="checkbox"]:checked + .checkbox-label .custom-checkbox-box {
    background: linear-gradient(135deg, var(--primary-grad-start), var(--primary-grad-end));
    border-color: transparent;
}

input[type="checkbox"]:checked + .checkbox-label .custom-checkbox-box::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

input[type="checkbox"]:focus-visible + .checkbox-label .custom-checkbox-box {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    clip-path: inset(50%);
    overflow: hidden;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    white-space: nowrap;
}

/* File Drop Zones */
.file-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    background: var(--bg-secondary);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-normal);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.file-drop-zone.dragover {
    border-color: var(--border-focus);
    background: rgba(59, 130, 246, 0.05);
    transform: scale(1.01);
}

.upload-icon {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.drop-text {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 5px 0;
    color: var(--text-primary);
}

.file-limit {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
}

/* Previews inside drop zones */
.file-preview-container {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    max-width: 400px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.photo-preview-image {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.preview-filename {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    text-align: left;
}

.remove-file-btn {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}

.remove-file-btn:hover {
    background: var(--error);
    color: white;
}

/* Multi-file preview list */
.multi-file-list {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.multi-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
}

/* Buttons */
.btn {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
    min-height: 44px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-grad-start), var(--primary-grad-end));
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(59, 130, 246, 0.3);
}

.btn-accent {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 4px 10px rgba(236, 72, 153, 0.2);
}

.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(236, 72, 153, 0.3);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-focus);
    color: var(--border-focus);
}

.btn-outline:hover {
    background: rgba(59, 130, 246, 0.05);
}

.btn-sm {
    padding: 6px 12px;
    min-height: 32px;
    font-size: 12px;
}

.step-navigation {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

.step-navigation button:only-child {
    margin-left: auto;
}

/* Sub-sections (for UAE resident) */
.form-sub-section {
    background: rgba(59, 130, 246, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-top: 10px;
}

.sub-section-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: var(--text-primary);
}

/* Education CRUD List */
.education-records-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.no-records-message {
    text-align: center;
    padding: 30px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
}

.no-records-message .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    margin-bottom: 8px;
}

.education-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}

.education-card:hover {
    transform: translateX(4px);
    border-left: 3px solid var(--primary-grad-start);
}

.edu-info h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.edu-info p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Dialog Modal */
.speaker-reg-modal {
    border: none;
    border-radius: var(--border-radius);
    padding: 0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    background: var(--bg-primary);
    max-width: 500px;
    width: 90%;
}

.speaker-reg-modal::backdrop {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.modal-box {
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.close-modal-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

#education-history-form {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

/* Digital Signature Canvas */
.signature-canvas-wrapper {
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    touch-action: none;
}

#signature-pad-canvas {
    display: block;
    width: 100%;
    height: 150px;
    cursor: crosshair;
}

.signature-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: -4px 0 10px 0;
}

/* Summary Card styling */
.registration-summary-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.summary-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 15px 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.summary-group {
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
    font-size: 14px;
}

.summary-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.summary-value {
    color: var(--text-primary);
}

/* Completed & Success Screens */
.success-completed-panel {
    text-align: center;
    padding: 40px 20px;
}

.success-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.success-check-icon {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: var(--success);
}

.success-completed-panel h3 {
    font-size: 22px;
    margin: 0 0 10px 0;
}

.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.status-badge.waiting {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-badge.approved {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.success-message-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 15px 0 25px 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
