/* Mock Test Platform - Main Stylesheet */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* Header Styles */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header-content h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.main-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.admin-link {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.stat {
    text-align: center;
    background: rgba(255,255,255,0.1);
    padding: 1.5rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    min-width: 120px;
}

.stat i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Section Styles */
section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 3rem;
    color: #2c3e50;
    font-weight: 600;
}

.section-title i {
    margin-right: 0.5rem;
    color: #667eea;
}

/* Tests Section */
.tests-section {
    background: white;
}

.tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.test-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.test-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.test-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.test-header h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    font-weight: 600;
    flex: 1;
}

.test-subject {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.test-subject.reasoning { background: #e3f2fd; color: #1976d2; }
.test-subject.maths { background: #f3e5f5; color: #7b1fa2; }
.test-subject.english { background: #e8f5e8; color: #388e3c; }
.test-subject.it_computer { background: #fff3e0; color: #f57c00; }
.test-subject.petroleum { background: #fce4ec; color: #c2185b; }
.test-subject.mixed { background: #f5f5f5; color: #616161; }

.test-description {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.test-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.info-item i {
    color: #667eea;
    width: 16px;
}

.test-actions {
    text-align: center;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

/* Subjects Section */
.subjects-section {
    background: #f8f9fa;
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.subject-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.subject-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

.subject-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.question-count {
    color: #666;
    font-weight: 600;
    margin-bottom: 1rem;
}

.subject-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.topic-tag {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.topic-tag.more {
    background: #667eea;
    color: white;
}

/* Features Section */
.features-section {
    background: white;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: 15px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: white;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.feature-card i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.feature-card p {
    color: #666;
    line-height: 1.5;
}

/* Footer */
.main-footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: #ecf0f1;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #34495e;
    color: #bdc3c7;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1rem 2rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.test-instructions {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.test-instructions h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.test-instructions ul {
    padding-left: 1.5rem;
}

.test-instructions li {
    margin-bottom: 0.5rem;
    color: #666;
}

/* No Tests Message */
.no-tests {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.no-tests i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ffc107;
}

/* Test Page Styles */
.test-page {
    background: #f8f9fa;
    min-height: 100vh;
}

.test-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.test-header {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.test-info h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.question-counter {
    font-size: 1.1rem;
    color: #666;
    font-weight: 600;
}

.timer-container {
    text-align: center;
}

.timer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.timer.warning {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    animation: pulse 1s infinite;
}

.timer.critical {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.test-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

.question-navigation {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.question-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.question-nav-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.question-nav-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.question-nav-btn.current {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.question-nav-btn.answered {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.nav-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.current { background: #667eea; }
.legend-color.answered { background: #28a745; }
.legend-color.unanswered { background: white; border: 2px solid #e9ecef; }

.question-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.question-text h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.question-text p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: #333;
}

.options {
    margin-bottom: 2rem;
}

.option-label {
    display: block;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.option-label:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.option-label input[type="radio"] {
    display: none;
}

.option-label input[type="radio"]:checked + .option-text {
    color: #667eea;
    font-weight: 600;
}

.option-label:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: #f8f9ff;
}

.option-text {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.option-letter {
    background: #e9ecef;
    color: #495057;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.option-label:has(input[type="radio"]:checked) .option-letter {
    background: #667eea;
    color: white;
}

.test-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

.navigation-buttons {
    display: flex;
    gap: 1rem;
}

.test-actions {
    display: flex;
    gap: 1rem;
}

/* Result Page Styles */
.result-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.result-header {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.result-score {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.result-score.pass { color: #28a745; }
.result-score.fail { color: #dc3545; }

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.result-stat {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.result-stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
}

.result-stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.25rem;
}

.questions-review {
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.review-header {
    background: #f8f9fa;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
}

.review-question {
    padding: 2rem;
    border-bottom: 1px solid #e9ecef;
}

.review-question:last-child {
    border-bottom: none;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.question-number {
    font-weight: 700;
    color: #2c3e50;
}

.answer-status {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.answer-status.correct {
    background: #d4edda;
    color: #155724;
}

.answer-status.incorrect {
    background: #f8d7da;
    color: #721c24;
}

.answer-status.unanswered {
    background: #fff3cd;
    color: #856404;
}

.review-options {
    margin: 1rem 0;
}

.review-option {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.review-option.correct {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.review-option.selected {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.review-option.selected.correct {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.explanation {
    background: #e3f2fd;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #2196f3;
    margin-top: 1rem;
}

.explanation strong {
    color: #1976d2;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .main-nav {
        gap: 1rem;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .hero-stats {
        gap: 1.5rem;
    }
    
    .tests-grid,
    .subjects-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .test-content {
        grid-template-columns: 1fr;
    }
    
    .question-navigation {
        position: static;
        order: 2;
    }
    
    .question-section {
        order: 1;
    }
    
    .test-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .navigation-buttons,
    .test-actions {
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .result-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .test-header {
        flex-direction: column;
        text-align: center;
    }
    
    .question-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .result-stats {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .main-header,
    .main-footer,
    .test-controls,
    .question-navigation {
        display: none;
    }
    
    .test-content {
        grid-template-columns: 1fr;
    }
    
    body {
        background: white;
    }
    
    .question-section,
    .result-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Anti-cheating styles */
.test-page {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.test-page * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
