/* ===================================
   Add Student Page Styles
   =================================== */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: #F4F5F7;
    color: #172B4D;
    line-height: 1.5;
}

/* Header Styles */
.header {
    background: white;
    border-bottom: 1px solid #DFE1E6;
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo h1 {
    color: #0052CC;
    font-size: 24px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-btn {
    background: #F4F5F7;
    color: #42526E;
    border: 1px solid #DFE1E6;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: #EBECF0;
    border-color: #C1C7D0;
}

.logout-btn {
    background: #F4F5F7;
    color: #42526E;
    border: 1px solid #DFE1E6;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: #EBECF0;
    border-color: #C1C7D0;
}

/* Main Content */
.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
}

.page-header {
    background: white;
    border-radius: 8px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: #172B4D;
    margin-bottom: 8px;
}

.page-subtitle {
    color: #6B778C;
    font-size: 16px;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    padding: 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.step.completed {
    background: #E3FCEF;
    color: #006644;
}

.step.active {
    background: #DEEBFF;
    color: #0052CC;
}

.step.pending {
    background: #F4F5F7;
    color: #6B778C;
}

.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.step.completed .step-number {
    background: #36B37E;
    color: white;
}

.step.active .step-number {
    background: #0052CC;
    color: white;
}

.step.pending .step-number {
    background: #DFE1E6;
    color: #6B778C;
}

/* Section and Animation */
.section {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Card */
.form-card {
    background: white;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: #172B4D;
    margin-bottom: 24px;
    text-align: center;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #0052CC;
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #FAFBFC;
    margin-bottom: 24px;
}

.upload-area:hover {
    border-color: #0043A3;
    background: rgba(0, 82, 204, 0.05);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #0043A3;
    background: rgba(0, 82, 204, 0.1);
    border-style: solid;
}

.upload-icon {
    font-size: 48px;
    color: #0052CC;
    margin-bottom: 16px;
}

.upload-text {
    color: #172B4D;
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 600;
}

.upload-subtext {
    color: #6B778C;
    font-size: 14px;
}

.file-input {
    display: none;
}

/* Preview */
.preview-container {
    text-align: center;
    margin: 24px 0;
}

.preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.preview-image:hover {
    transform: scale(1.02);
}

.file-info {
    margin: 16px 0;
    padding: 16px;
    background: #F4F5F7;
    border-radius: 8px;
    font-size: 14px;
    color: #172B4D;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.option-card {
    padding: 24px;
    border: 2px solid #DFE1E6;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.option-card:hover {
    border-color: #0052CC;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 82, 204, 0.1);
}

.option-card.selected {
    border-color: #0052CC;
    background: rgba(0, 82, 204, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 82, 204, 0.2);
}

.option-icon {
    font-size: 32px;
    margin-bottom: 12px;
    color: #0052CC;
}

.option-title {
    font-size: 16px;
    font-weight: 600;
    color: #172B4D;
    margin-bottom: 6px;
}

.option-description {
    font-size: 14px;
    color: #6B778C;
}

/* Programs */
.programs-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #DFE1E6;
    border-radius: 8px;
    background: #FAFBFC;
    padding: 16px;
    margin-bottom: 32px;
}

.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.program-card {
    padding: 16px;
    border: 2px solid #DFE1E6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.program-card:hover {
    border-color: #0052CC;
    transform: translateY(-1px);
}

.program-card.selected {
    border-color: #0052CC;
    background: rgba(0, 82, 204, 0.05);
}

.program-title {
    font-size: 15px;
    font-weight: 600;
    color: #172B4D;
}

/* Form Elements */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-weight: 600;
    color: #172B4D;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-label.required::after {
    content: " *";
    color: #DE350B;
}

.form-input {
    padding: 12px;
    border: 2px solid #DFE1E6;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #0052CC;
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
}

.form-input.filled {
    border-color: #36B37E;
    background: rgba(54, 179, 126, 0.05);
}

.form-input.error {
    border-color: #DE350B;
    background: rgba(222, 53, 11, 0.05);
}

.field-status {
    font-size: 12px;
    margin-top: 6px;
    color: #6B778C;
    font-weight: 500;
}

.field-status.extracted { 
    color: #36B37E; 
}

.field-status.manual { 
    color: #FFAB00; 
}

.field-status.required { 
    color: #DE350B; 
}

.field-status.valid { 
    color: #36B37E; 
}

/* Buttons */
.btn {
    background: #0052CC;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    min-width: 120px;
}

.btn:hover:not(:disabled) {
    background: #0043A3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 82, 204, 0.3);
}

.btn:disabled {
    background: #A5ADBA;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-success { 
    background: #36B37E; 
}

.btn-success:hover:not(:disabled) { 
    background: #00875A; 
    box-shadow: 0 4px 12px rgba(54, 179, 126, 0.3);
}

.btn-danger { 
    background: #DE350B; 
}

.btn-danger:hover:not(:disabled) { 
    background: #BF2600; 
    box-shadow: 0 4px 12px rgba(222, 53, 11, 0.3);
}

.btn-secondary {
    background: #F4F5F7;
    color: #42526E;
    border: 1px solid #DFE1E6;
}

.btn-secondary:hover:not(:disabled) {
    background: #EBECF0;
    border-color: #C1C7D0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.button-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Status Messages */
.status-message {
    padding: 16px;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
    display: none;
    margin: 16px 0;
}

.status-message.success {
    background: #E3FCEF;
    color: #006644;
    border: 1px solid #ABF5D1;
}

.status-message.error {
    background: #FFEBE6;
    color: #DE350B;
    border: 1px solid #FFBDAD;
}

.status-message.info {
    background: #DEEBFF;
    color: #0052CC;
    border: 1px solid #B3D4FF;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #EBECF0;
    border-radius: 3px;
    margin: 16px 0;
    overflow: hidden;
    display: none;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0052CC, #0065FF);
    width: 0%;
    transition: width 0.3s ease;
}

/* Magnify Modal */
.magnify-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    cursor: zoom-out;
}

.magnify-image {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #F4F5F7;
    border-top: 4px solid #0052CC;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Container */
.error-container {
    background: #FFEBE6;
    color: #DE350B;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 24px;
    text-align: center;
    border: 1px solid #FFBDAD;
    display: none;
}

/* Media Queries */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .main-content {
        padding: 16px;
    }

    .page-header {
        padding: 24px 16px;
    }

    .form-card {
        padding: 24px 16px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .step-indicator {
        flex-direction: column;
        gap: 8px;
    }
}