/* Frontend Styles for UWU Exam Manager Plugin */

/* Login Form Styles */
.uwu-login-form {
    max-width: 400px;
    margin: 20px auto;
    padding: 30px;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.uwu-login-form h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
}

.uwu-field {
    margin-bottom: 20px;
}

.uwu-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
}

.uwu-field input[type="text"],
.uwu-field input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    background: white;
    position: relative;
    z-index: 10;
}

.uwu-field input[type="text"]:focus,
.uwu-field input[type="password"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.uwu-field button {
    width: 100%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.uwu-field button:hover {
    background: linear-gradient(135deg, #2980b9, #3498db);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.uwu-field button:active {
    transform: translateY(0);
}

/* Ensure password field accessibility */
.uwu-field input[type="password"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-clip: padding-box;
}

.uwu-field input[type="password"]::-ms-reveal,
.uwu-field input[type="password"]::-ms-clear {
    display: none;
}

.uwu-field input[type="password"]:-webkit-autofill,
.uwu-field input[type="password"]:-webkit-autofill:hover,
.uwu-field input[type="password"]:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px white inset !important;
    box-shadow: 0 0 0 1000px white inset !important;
    background-color: white !important;
}

/* Results Page Styles */
.uwu-results {
    max-width: 800px;
    margin: 20px auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.uwu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 25px 30px;
}

.uwu-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
}

.uwu-header a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 8px 16px;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.uwu-header a:hover {
    background: #ecf0f1;
    color: #2c3e50;
}

/* Student Information Section */
.uwu-student-info {
    padding: 25px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.uwu-student-info h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
    display: inline-block;
}

.uwu-student-info p {
    margin: 10px 0;
    color: #34495e;
    font-size: 16px;
    line-height: 1.6;
}

.uwu-student-info strong {
    color: #2c3e50;
    font-weight: 600;
    display: inline-block;
    min-width: 140px;
}

/* Exam Results Section */
.uwu-exam-results {
    padding: 25px 30px;
    border-bottom: 1px solid #e9ecef;
}

.uwu-exam-results:last-child {
    border-bottom: none;
}

.uwu-exam-results h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 22px;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.uwu-exam-results p {
    margin: 8px 0;
    color: #34495e;
    font-size: 14px;
}

.uwu-exam-results strong {
    color: #2c3e50;
    font-weight: 600;
    display: inline-block;
    min-width: 120px;
}

/* Marks Section */
.uwu-marks {
    margin-top: 20px;
}

.uwu-marks h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.uwu-subjects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.uwu-subject {
    text-align: center;
    background: #f8f9fa;
    padding: 20px 15px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.uwu-subject:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-color: #3498db;
}

.uwu-subject h5 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.uwu-mark {
    font-size: 28px;
    font-weight: 700;
    color: #3498db;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* No Results Message */
.uwu-no-results {
    padding: 40px 30px;
    text-align: center;
    color: #666;
}

.uwu-no-results p {
    font-size: 16px;
    margin: 0;
}

/* Message Styles */
#uwu-login-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
}

.success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border: 2px solid #c3e6cb;
}

.error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border: 2px solid #f5c6cb;
}

/* Loading States */
.uwu-loading {
    opacity: 0.7;
    pointer-events: none;
}

.uwu-loading .uwu-field button {
    background: #95a5a6;
    cursor: not-allowed;
}

/* Field Validation */
.uwu-field-error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .uwu-login-form {
        margin: 10px;
        padding: 20px;
        max-width: none;
    }
    
    .uwu-results {
        margin: 10px;
        max-width: none;
    }
    
    .uwu-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 20px;
    }
    
    .uwu-header h2 {
        font-size: 24px;
    }
    
    .uwu-student-info,
    .uwu-exam-results {
        padding: 20px;
    }
    
    .uwu-subjects {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .uwu-subject {
        padding: 15px 10px;
    }
    
    .uwu-mark {
        font-size: 24px;
    }
    
    .uwu-field input[type="text"],
    .uwu-field input[type="password"] {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {
    .uwu-login-form {
        padding: 15px;
    }
    
    .uwu-header {
        padding: 15px;
    }
    
    .uwu-header h2 {
        font-size: 20px;
    }
    
    .uwu-student-info,
    .uwu-exam-results {
        padding: 15px;
    }
    
    .uwu-subjects {
        grid-template-columns: 1fr;
    }
    
    .uwu-subject {
        padding: 15px 10px;
    }
    
    .uwu-mark {
        font-size: 22px;
    }
    
    .uwu-student-info strong,
    .uwu-exam-results strong {
        min-width: auto;
        display: block;
        margin-bottom: 4px;
    }
}

/* Print Styles */
@media print {
    .uwu-header a,
    .uwu-login-info,
    .uwu-welcome-message,
    .uwu-logout-message {
        display: none !important;
    }
    
    .uwu-results {
        box-shadow: none !important;
        margin: 0 !important;
        border: 1px solid #000;
    }
    
    .uwu-header {
        background: #000 !important;
        color: #fff !important;
    }
    
    .uwu-subject {
        border: 1px solid #000 !important;
        page-break-inside: avoid;
    }
    
    .uwu-exam-info,
    .uwu-results-footer,
    .uwu-exam-results {
        page-break-inside: avoid;
    }
    
    .uwu-subjects {
        display: block;
    }
    
    .uwu-subject {
        display: inline-block;
        width: 45%;
        margin: 2%;
        vertical-align: top;
    }
}

/* Accessibility Improvements */
.uwu-field input:focus,
.uwu-field button:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

.uwu-skip-link:focus {
    position: absolute !important;
    top: 6px !important;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 4px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .uwu-login-form,
    .uwu-results {
        border: 2px solid #000;
    }
    
    .uwu-field input[type="text"],
    .uwu-field input[type="password"] {
        border: 2px solid #000;
    }
    
    .uwu-subject {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .uwu-field button,
    .uwu-subject,
    .uwu-field input[type="text"],
    .uwu-field input[type="password"] {
        transition: none;
    }
    
    .uwu-subject:hover {
        transform: none;
    }
    
    .uwu-field button:hover {
        transform: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .uwu-login-form {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .uwu-field label {
        color: #ecf0f1;
    }
    
    .uwu-field input[type="text"],
    .uwu-field input[type="password"] {
        background: #34495e;
        border-color: #4a5568;
        color: #ecf0f1;
    }
    
    .uwu-field input[type="text"]:focus,
    .uwu-field input[type="password"]:focus {
        border-color: #3498db;
    }
    
    .uwu-results {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .uwu-student-info {
        background: #34495e;
        border-color: #4a5568;
    }
    
    .uwu-student-info h3,
    .uwu-exam-results h3,
    .uwu-student-info p,
    .uwu-exam-results p {
        color: #ecf0f1;
    }
    
    .uwu-subject {
        background: #34495e;
        border-color: #4a5568;
    }
    
    .uwu-subject h5 {
        color: #ecf0f1;
    }
}