/**
 * Responsive CSS for Medical Tests App
 * Created: 2025-01-14
 * Description: Mobile-first responsive design for medical test application
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    list-style: none;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

/* Test Header Controls */
.test-header-controls {
    text-align: center;
    margin-bottom: 20px;
}

/* Test Stats Header */
.test-stats-header {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item .stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.stat-item .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #FFFFFF;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Login Section */
.login-section {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
}

.login-card h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.login-description {
    color: #000;
    margin-bottom: 30px;
    font-size: 1rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 25px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: 2px solid #1e7e34;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    color: white;
    border: 2px solid #c82333;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #c82333 0%, #d63384 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

/* Welcome Section */
.welcome-section {
    width: 100%;
    max-width: 600px;
    margin-bottom: 40px;
}

.welcome-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
}

.welcome-card h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2rem;
}

.welcome-description {
    color: #000;
    font-size: 1.1rem;
}

/* Navigation Grid */
.navigation-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    width: 100%;
    max-width: 600px;
    margin-bottom: 40px;
}

.nav-card {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    padding: 30px 20px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    text-align: center;
    display: block;
    border: 2px solid rgba(255,255,255,0.1);
}

.nav-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    text-decoration: none;
    color: white;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-color: rgba(255,255,255,0.2);
}

.nav-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.nav-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.nav-card p {
    color: rgba(255,255,255,0.9);
    font-size: 1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* Logout Section */
.logout-section {
    text-align: center;
    margin-top: 20px;
}

/* Test Page Styles */
.test-container {
    width: 100%;
    max-width: 800px;
}

.test-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.question-text {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #333;
    font-weight: 500;
}

.answers-list {
    list-style: none;
    margin-bottom: 30px;
    padding: 0;
}

.answer-item {
    margin-bottom: 15px;
}

.answer-option {
    display: block;
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    text-align: left;
}

.answer-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.answer-option.selected {
    border-color: #667eea;
    background: #e8f0ff;
}

.answer-option.correct {
    border-color: #28a745;
    background: #d4edda;
}

.answer-option.incorrect {
    border-color: #dc3545;
    background: #f8d7da;
}

.test-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Statistics Styles */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-bottom: 30px;
    list-style: none;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
}

.footer-actions, .empty-actions {
    gap: 20px;
    display: grid;
    margin: 20px 0;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #000;
    margin-bottom: 10px;
}

.stat-label {
    color: #000;
    font-size: 1.1rem;
}

button:disabled {
    color: #000;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e1e5e9;
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

/* Problematic Questions */
.problematic-list {
    list-style: none;
    padding: 0;
}

.problematic-item {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.problematic-question {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #333;
    font-weight: 500;
}

.answer-comparison {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 15px;
}

.answer-row {
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.user-answer {
    background: #f8d7da;
}

.correct-answer {
    background: #d4edda;
}

/* Footer */
.footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    padding: 20px 0;
    opacity: 0.8;
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (min-width: 768px) {
    .navigation-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .answer-comparison {
        grid-template-columns: 1fr 1fr;
    }
    
    .test-controls {
        justify-content: space-between;
    }
}

.problematic-actions {
    margin-top: 20px;
}

@media (min-width: 1024px) {
    .container {
        padding: 40px;
    }
    
    .header h1 {
        font-size: 3rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .test-card {
        padding: 40px;
    }
    
    .question-text {
        font-size: 1.3rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .nav-icon {
        font-size: 3.5rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .nav-card, .test-card, .stat-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
