@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8fafc;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Content */
.main-content {
    padding: 120px 0 40px 0;
}

/* Exam Info Section */
.exam-info {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.exam-info h2 {
    text-align: center;
    color: #1e293b;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.requirements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.req-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #3b82f6;
}

.req-icon {
    font-size: 2rem;
}

.req-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.req-item p {
    color: #64748b;
    font-size: 0.9rem;
}

/* Test Selection Section */
.test-selection {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.test-selection h2 {
    text-align: center;
    color: #1e293b;
    font-size: 2rem;
    margin-bottom: 2rem;
}

/* Tests Grid */
.tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Test Card */
.test-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    overflow: hidden;
}

.test-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.test-card.selected {
    border-color: #3b82f6;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px 8px 15px;
}

.pro-badge {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.free-badge {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.difficulty-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.difficulty-badge.easy {
    background: #f0fff4;
    color: #38a169;
    border: 1px solid #9ae6b4;
}

.difficulty-badge.medium {
    background: #fffbf0;
    color: #d69e2e;
    border: 1px solid #fbd38d;
}

.difficulty-badge.hard {
    background: #fff5f5;
    color: #e53e3e;
    border: 1px solid #feb2b2;
}

.difficulty-badge.expert {
    background: #faf5ff;
    color: #7c3aed;
    border: 1px solid #c4b5fd;
}

.difficulty-badge.advanced {
    background: #fdf2f8;
    color: #be185d;
    border: 1px solid #f9a8d4;
}

.test-content {
    padding: 0 15px 15px 15px;
}

/* Exam cards specific padding */
.test-card.exam-card .test-content {
    padding: 0 15px 40px 15px;
}

.test-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.test-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.test-category {
    background: #e0f2fe;
    color: #0369a1;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.test-category.exam-type {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #f59e0b;
}

.test-characters {
    background: #f1f5f9;
    color: #475569;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.test-actions {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: rgb(43, 145, 191);
    color: white;
    box-shadow: 0 2px 8px rgba(43, 145, 191, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(43, 145, 191, 0.4);
}

.btn-secondary {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

.btn-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-info:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}

/* Start Section */
.start-section {
    text-align: center;
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-start {
    background: rgb(43, 145, 191);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(43, 145, 191, 0.3);
    margin-bottom: 1rem;
}

.btn-start:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(43, 145, 191, 0.4);
}

.btn-start:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.test-info {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
}

/* Footer */
.footer {
    background: #2d3748;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

/* Messages */
.no-tests, .error-message {
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    font-size: 1rem;
    margin: 1rem 0;
}

.no-tests {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.error-message {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Attempted Test Styles */
.attempted-info {
    margin: 10px 0;
    padding: 8px 12px;
    background: #f0fdf4;
    border-radius: 8px;
    border-left: 3px solid #22c55e;
}

.attempted-badge {
    background: #22c55e;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 4px;
}

.result-summary-mini {
    display: flex;
    gap: 10px;
    font-size: 12px;
    font-weight: 500;
}

.result-summary-mini .qualified {
    color: #16a34a;
}

.result-summary-mini .not-qualified {
    color: #dc2626;
}

/* Result Modal */
.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9998;
}

.result-modal-content {
    position: relative;
    background: white;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    z-index: 10000;
}

.result-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.result-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.result-modal-body {
    padding: 2rem;
}

.result-status {
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.result-status.qualified {
    background: #f0fdf4;
    color: #16a34a;
    border: 2px solid #22c55e;
}

.result-status.not-qualified {
    background: #fef2f2;
    color: #dc2626;
    border: 2px solid #ef4444;
}

.result-details {
    margin-bottom: 1.5rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.result-item:last-child {
    border-bottom: none;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .requirements-grid {
        grid-template-columns: 1fr;
    }
    
    .tests-grid {
        grid-template-columns: 1fr;
    }
    
    .test-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .test-actions {
        flex-direction: column;
    }
    
    .exam-info, .test-selection, .start-section {
        padding: 1.5rem;
    }
}

/* Preview Modal */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9998;
}

.preview-content {
    position: relative;
    background: white;
    border-radius: 15px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    z-index: 10000;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
}

.preview-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.close-btn:hover {
    background-color: rgba(255,255,255,0.1);
}

.preview-body {
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.preview-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.preview-category {
    background: #e0f2fe;
    color: #0369a1;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.preview-category.exam-type {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #f59e0b;
}

.preview-characters {
    background: #f1f5f9;
    color: #475569;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.preview-difficulty {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.preview-difficulty.easy {
    background: #f0fff4;
    color: #38a169;
}

.preview-difficulty.medium {
    background: #fffbf0;
    color: #d69e2e;
}

.preview-difficulty.hard {
    background: #fff5f5;
    color: #e53e3e;
}

.preview-difficulty.expert {
    background: #faf5ff;
    color: #7c3aed;
}

.preview-difficulty.advanced {
    background: #fdf2f8;
    color: #be185d;
}

.preview-text {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    color: #2d3748;
    margin-bottom: 1.5rem;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
    max-height: 300px;
    overflow-y: auto;
}

.preview-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

@media (max-width: 768px) {
    .preview-content {
        width: 95%;
        margin: 1rem;
    }
    
    .preview-actions {
        flex-direction: column;
    }
    
    .preview-info {
        flex-direction: column;
        gap: 0.5rem;
    }
}