:root {
    --primary-color: #f0b429; 
    --secondary-color: #4ac7ff; 
    --bg-color: #020a1f;
    --container-bg: rgba(7, 16, 42, 0.7);
    --text-color: #f0f0f0;
    --border-glow: 0 0 5px var(--primary-color), 0 0 10px var(--primary-color), 0 0 15px var(--primary-color);
    --text-shadow: 0 0 3px var(--primary-color);
    --font-title: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: url('background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding-bottom: 60px; 
}

#app-container {
    width: 100%;
    max-width: 1200px; 
    padding: 20px;
    position: relative;
}

#main-layout {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr; 
    gap: 30px; 
}

#left-column, #middle-column, #right-column {
    display: flex;
    flex-direction: column;
    gap: 30px; 
}

#middle-column {
    position: relative; 
    min-height: 600px; 
}

.form-container, #quiz-container, .column-section { 
    background: var(--container-bg);
    border: 1px solid var(--primary-color);
    border-radius: 15px;
    padding: 30px 40px;
    box-shadow: var(--border-glow), inset 0 0 10px rgba(240, 180, 41, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    width: 100%; 
}

#registration-container, #quiz-container, #end-container, #certificate-container {
    width: 100%;
    height: 100%;
    position: absolute; 
    top: 0;
    left: 0;
}

.hidden {
    display: none !important;
    opacity: 0;
    transform: scale(0.9);
}

.active {
    display: block;
    opacity: 1;
    transform: scale(1);
}

.title {
    font-family: var(--font-title);
    text-align: center;
    color: var(--primary-color);
    text-shadow: var(--text-shadow);
    margin-bottom: 10px;
    font-size: 2rem;
}
.column-section h2 { 
     font-family: var(--font-title);
    text-align: center;
    color: var(--primary-color);
    text-shadow: var(--text-shadow);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.subtitle {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: #ccc;
}

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

.input-group input {
    width: 100%;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 1.1rem;
    transition: box-shadow 0.3s, border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 5px var(--secondary-color), 0 0 10px var(--secondary-color);
}

.input-group input::placeholder {
    color: #888;
}

button {
    width: 100%;
    padding: 15px;
    font-family: var(--font-title);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--bg-color);
    background-color: var(--primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.3s, box-shadow 0.3s, color 0.3s;
    box-shadow: var(--border-glow);
    display: flex;
    justify-content: center;
    align-items: center;
}

button:hover {
    background-color: var(--secondary-color);
    color: var(--text-color);
    box-shadow: 0 0 5px var(--secondary-color), 0 0 15px var(--secondary-color), 0 0 25px var(--secondary-color);
}

button:disabled {
    background-color: #555;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
}

.status-text {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #aaa;
    height: 1em;
}

.sponsor-text {
    text-align: center;
    margin-top: 25px;
    font-size: 0.9rem;
    color: #ccc;
    font-family: var(--font-body);
}

.collaborator-logos .single-logo-wrapper {
    width: 100%;
    height: 400px; 
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px; 
    overflow: hidden;
}

.collaborator-logos .single-logo-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; 
}

.sponsor-logo-placeholder {
    background: rgba(0,0,0, 0.1);
    border: 1px dashed var(--secondary-color);
    border-radius: 10px;
    height: 120px; 
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    overflow: hidden;
}

.sponsor-logo-placeholder video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.hyperlink-section {
    text-align: center;
    padding: 10px 20px; 
}

.hyperlink-section a {
    color: var(--secondary-color);
    text-decoration: none;
    font-family: var(--font-title);
    font-size: 1.1rem;
    transition: color 0.3s;
}

.hyperlink-section a:hover {
    color: var(--primary-color);
}

#quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#question-number {
    font-family: var(--font-title);
    font-size: 1.2rem;
    color: var(--primary-color);
}

#timer-countdown {
    font-family: var(--font-title);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--secondary-color);
    text-shadow: 0 0 5px var(--secondary-color);
    min-width: 40px;
    text-align: right;
}

#question-area {
    margin-bottom: 30px;
}

#question-text {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
}

#options-area {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.option-btn {
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 1.1rem;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
    width: 100%;
}

.option-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: var(--primary-color);
}

.option-btn.selected {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--text-color);
    font-weight: bold;
}

#certificate-container {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#certificate-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#certificate-canvas {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
    border: 2px solid var(--primary-color);
}

#certificate-actions {
    display: flex;
    gap: 20px;
}

#certificate-actions button {
    width: auto;
    padding: 10px 30px;
    font-size: 1rem;
}

#results-container .results-actions {
    margin-top: 30px;
}

.incorrect-answer-item {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ff4d4d;
    border-radius: 8px;
    background: rgba(255, 77, 77, 0.1);
    text-align: left;
}
.incorrect-answer-item .question {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1rem;
}
.incorrect-answer-item .options-review {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.incorrect-answer-item .option-review {
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 4px solid transparent;
}
.incorrect-answer-item .your-answer {
    background-color: rgba(255, 77, 77, 0.2);
    border-left-color: #ff4d4d;
}
.incorrect-answer-item .correct-answer {
    background-color: rgba(77, 255, 77, 0.2);
    border-left-color: #4dff4d;
}

#footer-links {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--container-bg);
    border: 1px solid var(--secondary-color);
    border-radius: 8px;
    padding: 10px 15px;
    box-shadow: 0 0 10px var(--secondary-color);
    z-index: 999;
    font-size: 0.9rem;
    font-family: var(--font-body);
    text-align: right;
    transition: opacity 0.3s ease;
}

#footer-links a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s;
}

#footer-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.footer-link-item {
    white-space: nowrap;
}

@media (max-width: 992px) {
    #main-layout {
        grid-template-columns: 1fr; 
        gap: 20px;
    }

    
    #middle-column { order: 1; min-height: auto; }
    #left-column   { order: 2; }
    #right-column  { order: 3; }

    #left-column, #right-column {
        flex-direction: row; 
        overflow-x: auto; 
        padding-bottom: 10px; 
        padding-right: 20px; 
        scroll-snap-type: x mandatory; 
    }

    #left-column .column-section,
    #right-column .column-section {
         min-width: 250px; 
         scroll-snap-align: start; 
    }
    
    .collaborator-logos .single-logo-wrapper {
        height: 250px; 
    }

     #registration-container, #quiz-container, #end-container, #certificate-container {
        position: static; 
        width: auto;
        height: auto;
        transform: none !important; 
        opacity: 1 !important; 
    }
    .hidden {
        display: none !important; 
    }
     .active {
         display: block;
     }
     body {
         padding-bottom: 80px; 
     }
     #footer-links {
        bottom: 10px;
        right: 10px;
        left: 10px; 
        text-align: center;
        padding: 10px;
     }
     .footer-link-item {
         white-space: normal; 
         line-height: 1.4;
     }
}

@media (max-width: 768px) {
     .form-container, #quiz-container, .column-section {
         padding: 20px 25px; 
     }
    .title {
        font-size: 1.5rem;
    }
     .column-section h2 {
        font-size: 1.2rem;
     }
     .input-group input, button, .option-btn {
         font-size: 1rem;
         padding: 12px;
     }
     #question-text {
         font-size: 1.2rem;
     }
     #footer-links {
        font-size: 0.8rem;
     }
    #certificate-canvas {
        max-width: 95vw;
        max-height: 75vh;
    }
    #certificate-actions {
        flex-direction: column;
        width: 80%;
    }
    #certificate-actions button {
        width: 100%;
    }
    .collaborator-logos .single-logo-wrapper {
        height: 200px; 
    }
}