/**
 * Student Profile Edit Styles
 * Professional CSS for student profile editing page
 */

/* Form Input Styling */
input[type="text"], 
input[type="email"], 
input[type="tel"], 
input[type="date"], 
input[type="file"],
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    background-color: #ffffff;
}

/* Focus States for Form Inputs */
input[type="text"]:focus, 
input[type="email"]:focus, 
input[type="tel"]:focus, 
input[type="date"]:focus, 
input[type="file"]:focus,
select:focus {
    outline: none;
    border-color: #0a9793;
    box-shadow: 0 0 0 3px rgba(10, 151, 147, 0.1);
}

/* Form Actions Section */
.form-actions {
    min-height: 60px;
    padding: 1.5rem 0;
    background-color: #ffffff;
    border-top: 2px solid #e5e7eb;
    margin-top: 2rem;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* Primary Submit Button Styling */
button[type="submit"] {
    background-color: #0a9793 !important;
    color: #ffffff !important;
    border: 2px solid #0a9793 !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 0.375rem !important;
    transition: all 0.2s ease-in-out !important;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1) !important;
}

button[type="submit"]:hover {
    background-color: #087f7b !important;
    border-color: #087f7b !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px -1px rgba(0, 0, 0, 0.15), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

button[type="submit"]:active {
    background-color: #065f5d !important;
    border-color: #065f5d !important;
    transform: translateY(0) !important;
    box-shadow: 0 1px 2px -1px rgba(0, 0, 0, 0.1) !important;
}

button[type="submit"]:disabled {
    background-color: #6b7280 !important;
    border-color: #6b7280 !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
    transform: none !important;
}

/* Drag and Drop Area Styling */
.drag-drop-area {
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    background-color: #f9fafb;
    border-style: dashed !important;
    border-width: 2px !important;
    border-color: #9ca3af !important;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
}

.drag-drop-area.drag-over {
    border-color: #0a9793 !important;
    background-color: rgba(10, 151, 147, 0.05);
    transform: scale(1.02);
    border-style: dashed !important;
}

.drag-drop-area:hover {
    border-color: #0a9793 !important;
    background-color: rgba(10, 151, 147, 0.02);
    border-style: dashed !important;
}

/* Upload Content Animation */
.upload-content {
    transition: all 0.3s ease;
}

.drag-drop-area.drag-over .upload-content {
    transform: scale(1.02);
}

/* Upload Success State */
.upload-success {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: scale(1); 
    }
}

/* Browse Files Button Styling */
.browse-files-btn {
    background-color: #ffffff !important;
    border: 2px solid #0a9793 !important;
    color: #0a9793 !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 0.375rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease-in-out !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.browse-files-btn:hover {
    background-color: #0a9793 !important;
    border-color: #0a9793 !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.browse-files-btn:active {
    background-color: #087f7b !important;
    border-color: #087f7b !important;
    transform: translateY(0) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

/* Avatar Preview Styling */
#avatar-preview {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem; /* Square with rounded corners */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    width: 120px !important;
    height: 120px !important;
    border: 3px solid #e5e7eb;
    background-color: #f9fafb;
}

#avatar-preview img {
    transition: all 0.3s ease;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: 0.375rem;
}

#avatar-preview img:hover {
    transform: scale(1.05);
}

/* Avatar preview container */
.avatar-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Cancel Button Styling */
.cancel-btn {
    background-color: #ffffff !important;
    border: 2px solid #d1d5db !important;
    color: #374151 !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 0.375rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease-in-out !important;
    cursor: pointer !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.cancel-btn:hover {
    background-color: #f9fafb !important;
    border-color: #9ca3af !important;
    color: #111827 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1) !important;
}

/* Error Message Styling */
.error-message {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.error-message::before {
    content: "⚠";
    margin-right: 0.25rem;
}

/* Success Message Styling */
.success-message {
    color: #0a9793;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.success-message::before {
    content: "✓";
    margin-right: 0.25rem;
}

/* Validation States */
.field-valid {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.field-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Loading State */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #0a9793;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .form-actions {
        padding: 1rem 0;
        position: relative;
    }
    
    .drag-drop-area {
        padding: 1.5rem 1rem;
    }
    
    button[type="submit"], 
    .browse-files-btn, 
    .cancel-btn {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
    }
    
    .form-actions {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
button:focus-visible,
.browse-files-btn:focus-visible,
.cancel-btn:focus-visible {
    outline: 2px solid #0a9793;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    button[type="submit"] {
        border: 3px solid #000000 !important;
    }
    
    .browse-files-btn {
        border: 3px solid #000000 !important;
    }
    
    .cancel-btn {
        border: 3px solid #000000 !important;
    }
}
