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

body {
    font-family: 'Lato', sans-serif;
    background-image: url('assets/bg-page-login.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo {
    margin-bottom: 50px;
}

.logo img {
    max-height: 80px;
    width: auto;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    margin: 20px auto;
    text-align: center;
}

.spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-radius: 50%;
    border-top: 5px solid #DC1E2D;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

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

.card-container {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Ensure mobile single column for any card containers */
@media (max-width: 768px) {
    .card-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        margin: 0 10px;
    }
}

.card {
    background: white;
    border-radius: 15px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 400px;
    cursor: pointer;
}

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

.card-icon {
    margin-bottom: 20px;
}

.card-icon i {
    font-size: 48px;
    color: rgb(192, 0, 0);
}

.card-title {
    font-size: 24px;
    font-weight: bold;
    color: rgb(192, 0, 0);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.card-description {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
}

/* Responsive design */
@media (max-width: 768px) {
    .card-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .card {
        width: 100%;
        max-width: 450px;
    }
    
    .logo img {
        max-height: 60px;
    }
    
    .card-title {
        font-size: 20px;
    }
    
    .card-description {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .card {
        padding: 30px 20px;
    }
    
    .card-icon i {
        font-size: 40px;
    }

    .card-title {
        font-size: 18px;
    }
}

/* Back Button */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: rgb(192, 0, 0);
    background-color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 30px;
    padding: 12px 20px;
    border: 2px solid rgb(192, 0, 0);
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(192, 0, 0, 0.2);
    transition: all 0.3s ease;
    text-decoration: none;
}

.back-button:hover {
    background-color: rgb(192, 0, 0);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(192, 0, 0, 0.3);
}

.back-button i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.back-button:hover i {
    transform: translateX(-2px);
}

/* Section Title */
.section-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin-bottom: 30px;
}

.exam-title {
    font-size: 20px;
    color: rgb(192, 0, 0);
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
}

/* Exam Grid */
.exam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Exam Card */
.exam-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.exam-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 15px;
}

.exam-header h3 {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 0;
    flex: 1;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.status-badge.expired {
    background-color: #fee2e2;
    color: rgb(192, 0, 0);
}

.status-badge.active {
    background-color: #dcfce7;
    color: #16a34a;
}

.status-badge.pending {
    background-color: #fef3c7;
    color: #d97706;
}

.exam-info {
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.info-row .label {
    color: #666;
    font-weight: 500;
}

.info-row .value {
    color: #333;
    font-weight: 600;
    text-align: right;
}

/* Register Button */
.register-btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.register-btn.active {
    background-color: rgb(192, 0, 0);
    color: white;
}

.register-btn.active:hover {
    background-color: rgb(160, 0, 0);
    transform: translateY(-1px);
}

.register-btn.disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Form Styles */
.form-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: rgb(192, 0, 0);
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.btn-cancel,
.btn-submit {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn-cancel {
    background-color: #f3f4f6;
    color: #374151;
}

.btn-cancel:hover {
    background-color: #e5e7eb;
}

.btn-submit {
    background-color: rgb(192, 0, 0);
    color: white;
}

.btn-submit:hover {
    background-color: rgb(160, 0, 0);
    transform: translateY(-1px);
}

/* Lookup Results */
.result-container {
    max-width: 800px;
    margin: 0 auto;
}

.result-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.result-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f3f4f6;
}

.result-header h3 {
    font-size: 20px;
    color: rgb(192, 0, 0);
    margin-bottom: 10px;
}

.result-header .student-info {
    font-size: 16px;
    color: #666;
}

.score-section {
    margin-bottom: 25px;
}

.score-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.score-item {
    text-align: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.score-item.total {
    background: linear-gradient(135deg, rgb(192, 0, 0), rgb(160, 0, 0));
    color: white;
    border-color: rgb(192, 0, 0);
}

.score-label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
    color: #666;
}

.score-item.total .score-label {
    color: #fecaca;
}

.score-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.score-item.total .score-value {
    color: white;
}

.result-details {
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.detail-label {
    color: #666;
    font-weight: 500;
}

.detail-value {
    color: #333;
    font-weight: 600;
}

.no-result {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.no-result i {
    font-size: 48px;
    color: rgb(192, 0, 0);
    margin-bottom: 20px;
}

.no-result h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 10px;
}

.no-result p {
    color: #666;
    font-size: 16px;
    line-height: 1.5;
}

/* Test Report Styles */
.test-report {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    border-radius: 10px;
}

.report-title {
    color: #C00000;
    text-align: center;
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: bold;
}

.report-subtitle {
    color: #666;
    text-align: center;
    font-size: 20px;
    margin-bottom: 30px;
}

.scores {
    margin-top: 40px;
}

.overall-score {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.overall-score h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

.overall-score .score {
    font-size: 48px;
    font-weight: bold;
    color: #C00000;
    margin-bottom: 5px;
}

.score-range {
    color: #666;
    font-size: 14px;
}

.detail-scores {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.score-item {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.score-item .score {
    font-size: 36px;
    font-weight: bold;
    color: #C00000;
    margin-bottom: 5px;
}

.score-item .score-label {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    margin-top: 10px;
}

.student-info {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: bold;
    color: #333;
}

.info-value {
    color: #666;
}

.actions {
    margin-top: 40px;
    text-align: center;
}

.actions .btn {
    margin: 0 10px;
}

/* Additional Info Styles */
.additional-info {
    margin: 30px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border-left: 4px solid #C00000;
}

.info-section h4 {
    color: #C00000;
    margin-bottom: 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 3px solid #C00000;
}

.detail-item span:first-child {
    font-weight: 600;
    color: #333;
}

.detail-item span:last-child {
    font-weight: 700;
    color: #C00000;
    background: #fff2f2;
    padding: 4px 8px;
    border-radius: 4px;
}

.small-text {
    font-size: 14px;
    color: #666;
    margin-top: -10px;
}

/* Additional Responsive Design */
@media (max-width: 768px) {
    .exam-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
        margin: 0 10px;
    }

    .exam-card {
        padding: 20px;
        width: 100%;
        max-width: 100%;
    }

    .exam-header {
        flex-direction: column;
        gap: 10px;
    }

    .exam-header h3 {
        font-size: 16px;
    }

    .status-badge {
        align-self: flex-start;
    }

    .info-row {
        flex-direction: column;
        gap: 2px;
    }

    .info-row .value {
        text-align: left;
        font-weight: 500;
    }

    .section-title {
        font-size: 24px;
    }

    .form-container {
        padding: 20px;
        margin: 0 15px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-cancel,
    .btn-submit {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .back-button {
        font-size: 14px;
        padding: 10px 16px;
        border-radius: 20px;
    }

    .section-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .exam-title {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .exam-card {
        padding: 15px;
    }

    .exam-header h3 {
        font-size: 15px;
    }

    .info-row {
        font-size: 13px;
    }

    .form-container {
        padding: 15px;
        margin: 0 10px;
    }

    .form-group input,
    .form-group select {
        padding: 10px 12px;
        font-size: 14px;
    }

    .btn-cancel,
    .btn-submit {
        padding: 10px 20px;
        font-size: 14px;
    }

    .result-card {
        padding: 20px;
        margin: 0 15px 20px 15px;
    }

    .score-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .score-item {
        padding: 12px;
    }

    .score-value {
        font-size: 20px;
    }

    .result-details {
        padding: 15px;
    }

    .detail-row {
        flex-direction: column;
        gap: 2px;
    }

    .no-result {
        margin: 0 15px;
        padding: 30px 15px;
    }

    .no-result i {
        font-size: 40px;
    }

    .no-result h3 {
        font-size: 18px;
    }

    .no-result p {
        font-size: 14px;
    }
}
