/* Reset and Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --darkBlue: #010a43;
    --lightGreen: #a7e9af;
    --whiteClr: #fff;
    --lightBlue: rgba(0, 64, 128, 0.2);
    --intenseBlue: #46b3e6;
    --errorRed: #e74c3c;
    --successGreen: #27ae60;
    --warningOrange: #f39c12;
}

:focus {
    outline: 2px solid #f8dc88;
}

html {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--whiteClr);
    text-align: left;
    background: linear-gradient(135deg, var(--darkBlue) 0%, #1e3c72 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Container */
.container {
    width: 100%;
    max-width: 800px;
    background-color: var(--lightBlue);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header__title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, var(--lightGreen), var(--intenseBlue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header__description {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.illustration {
    width: 100%;
    max-width: 250px;
    margin: 20px auto;
    display: block;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
}

/* Survey Form */
.survey {
    padding: 20px;
}

/* Progress Bar */
.progressbar {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    position: relative;
    gap: 50px;
}

.progressbar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    width: 200px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
    z-index: 0;
}

.progressbar__step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.1rem;
    z-index: 1;
    transition: all 0.3s ease-in-out;
    border: 3px solid transparent;
}

.progressbar__step.active {
    background-color: var(--lightGreen);
    color: var(--darkBlue);
    border-color: var(--intenseBlue);
    transform: scale(1.1);
}

.progressbar__step.completed {
    background-color: var(--successGreen);
    color: var(--whiteClr);
}

/* Survey Panels */
.survey__panel {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.survey__panel.active {
    display: block;
}

.survey__panel h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--lightGreen);
    font-size: 1.8rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Groups */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1rem;
    font-weight: 500;
}

.required {
    color: var(--errorRed);
}

.form-control {
    display: block;
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--darkBlue);
    background-color: var(--whiteClr);
    border: 2px solid transparent;
    border-radius: 8px;
    transition: all 0.3s ease-in-out;
    font-family: 'Poppins', sans-serif;
}

.form-control:focus {
    border-color: var(--intenseBlue);
    box-shadow: 0 0 0 0.2rem rgba(70, 179, 230, 0.25);
    transform: translateY(-2px);
}

.form-control.error {
    border-color: var(--errorRed);
    box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.25);
}

.form-control.success {
    border-color: var(--successGreen);
    box-shadow: 0 0 0 0.2rem rgba(39, 174, 96, 0.25);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Error Messages */
.error-message {
    display: block;
    color: var(--errorRed);
    font-size: 0.875rem;
    margin-top: 5px;
    min-height: 20px;
}

/* Questions */
.question-item {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid transparent;
    transition: all 0.3s ease-in-out;
}

.question-item:hover {
    border-color: var(--intenseBlue);
    transform: translateY(-2px);
}

.question-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 15px;
    color: var(--whiteClr);
}

.options {
    display: grid;
    gap: 10px;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.option-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.option-item input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.option-item label {
    cursor: pointer;
    margin: 0;
    flex: 1;
}

/* Student Info */
.student-info {
    background-color: rgba(167, 233, 175, 0.2);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid var(--lightGreen);
}

.student-info h3 {
    margin: 0 0 10px 0;
    color: var(--lightGreen);
}

.student-info p {
    margin: 5px 0;
    font-size: 0.95rem;
}

/* Result Container */
.result-container {
    text-align: center;
    padding: 30px;
}

.result-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 20px;
    border: 2px solid var(--lightGreen);
}

.result-passed {
    border-color: var(--successGreen);
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.2) 0%, rgba(39, 174, 96, 0.1) 100%);
}

.result-failed {
    border-color: var(--errorRed);
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.2) 0%, rgba(231, 76, 60, 0.1) 100%);
}

.result-score {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.result-score.passed {
    color: var(--successGreen);
}

.result-score.failed {
    color: var(--errorRed);
}

.result-message {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.result-detail {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
}

.result-detail-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--lightGreen);
}

.result-detail-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Buttons */
.button-group {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    gap: 15px;
}

.button-group button {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease-in-out;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Poppins', sans-serif;
}

.prev-btn {
    background-color: #6c757d;
    color: var(--whiteClr);
}

.prev-btn:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.next-btn {
    background-color: var(--intenseBlue);
    color: var(--whiteClr);
}

.next-btn:hover {
    background-color: #36a2d6;
    transform: translateY(-2px);
}

.retry-btn {
    background-color: var(--warningOrange);
    color: var(--whiteClr);
}

.retry-btn:hover {
    background-color: #e67e22;
    transform: translateY(-2px);
}

.certificate-btn {
    background-color: var(--successGreen);
    color: var(--whiteClr);
}

.certificate-btn:hover {
    background-color: #229954;
    transform: translateY(-2px);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
    color: var(--whiteClr);
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--lightGreen);
}

.loading-spinner p {
    font-size: 1.1rem;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    .header__title {
        font-size: 2rem;
    }
    
    .progressbar {
        gap: 30px;
    }
    
    .progressbar::before {
        width: 120px;
    }
    
    .progressbar__step {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group button {
        width: 100%;
        justify-content: center;
    }
    
    .result-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header__title {
        font-size: 1.8rem;
    }
    
    .survey__panel h2 {
        font-size: 1.5rem;
    }
    
    .form-control {
        padding: 10px 12px;
    }
    
    .question-item {
        padding: 15px;
    }
    
    .result-score {
        font-size: 2.5rem;
    }
}


/* Student Info Result */
.student-info-result {
    background: linear-gradient(135deg, rgba(167, 233, 175, 0.2) 0%, rgba(167, 233, 175, 0.1) 100%);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid var(--lightGreen);
    border-right: 4px solid var(--lightGreen);
}

.student-info-result h3 {
    margin: 0 0 15px 0;
    color: var(--lightGreen);
    text-align: center;
    font-size: 1.3rem;
}

.student-info-result p {
    margin: 8px 0;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
}

.student-info-result strong {
    color: var(--whiteClr);
    min-width: 100px;
}

/* Enhanced Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    display: none;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification i {
    margin-right: 10px;
    font-size: 1.1rem;
}

.notification-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border-left: 4px solid #2ecc71;
}

.notification-error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-left: 4px solid #c0392b;
}

.notification-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border-left: 4px solid #e67e22;
}

.notification-info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-left: 4px solid #2980b9;
}

/* Loading Overlay Enhancement */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(1, 10, 67, 0.9) 0%, rgba(30, 60, 114, 0.9) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    text-align: center;
    color: var(--whiteClr);
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--lightGreen);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.9;
}

/* Progress Bar Enhancement for Returning Users */
.progressbar__step.returning {
    background: linear-gradient(135deg, var(--lightGreen) 0%, var(--intenseBlue) 100%);
    color: var(--darkBlue);
    border-color: var(--lightGreen);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1.1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1.1); }
}

/* Returning User Banner */
.returning-user-banner {
    background: linear-gradient(135deg, rgba(167, 233, 175, 0.3) 0%, rgba(70, 179, 230, 0.3) 100%);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid var(--lightGreen);
    text-align: center;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.returning-user-banner h3 {
    margin: 0 0 10px 0;
    color: var(--lightGreen);
    font-size: 1.2rem;
}

.returning-user-banner p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
}

/* Clear Data Button */
.clear-data-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    z-index: 1000;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.clear-data-btn:hover {
    opacity: 1;
}

/* Mobile Responsiveness for New Elements */
@media (max-width: 768px) {
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .student-info-result p {
        flex-direction: column;
        gap: 5px;
    }
    
    .student-info-result strong {
        min-width: auto;
    }
    
    .clear-data-btn {
        bottom: 10px;
        left: 10px;
        font-size: 0.8rem;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .loading-spinner {
        padding: 20px;
        margin: 20px;
    }
    
    .loading-spinner i {
        font-size: 2.5rem;
    }
    
    .returning-user-banner {
        margin: 10px;
        padding: 12px 15px;
    }
}

