:root {
    --bg-dark: #0A0A0A;
    --bg-card: #141414;
    --text-primary: #ffffff;
    --text-secondary: #B3B3B3;
    --accent-primary: #FFC107; /* Gold */
    --accent-primary-hover: rgba(255, 193, 7, 0.8); /* Softer Gold for hover */
    --accent-secondary: #03A9F4; /* Blue */
    --border-color: #2A2A2A;
    --shadow-color: rgba(0, 0, 0, 0.8);
    --success-color: #4CAF50;
    --error-color: #F44336;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.8;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Style for invalid input fields */
.form-group input.invalid,
.form-group textarea.invalid {
    border-bottom-color: var(--error-color) !important;
}
.form-group .error-message {
    color: var(--error-color);
    font-size: 0.9rem;
    position: absolute;
    bottom: -25px;
    left: 0;
    display: none; /* Hidden by default */
}
.form-group input.invalid + label + .error-message,
.form-group textarea.invalid + label + .error-message {
    display: block; /* Show when input is invalid */
}


/* Canvas bầu trời sao */
#starry-sky-canvas {
    position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none;
}

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

h1,h2,h3,h4 { font-family: 'Oswald', sans-serif; font-weight: 700; line-height: 1.2; letter-spacing: 1px; }
h1 { font-size: clamp(1.8rem, 5.5vw, 4.5rem); color: #fff; text-shadow: 0 5px 20px var(--shadow-color); }
h2 { font-size: clamp(2.2rem, 5vw, 3.2rem); color: var(--accent-primary); margin-bottom: 50px; text-align: center; position: relative; padding-bottom: 15px; }
h2::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 80px; height: 4px; background-color: var(--accent-primary); border-radius: 2px; }
h3 { font-size: 1.7rem; color: var(--accent-secondary); margin-bottom: 20px; text-transform: capitalize; }
h4 { font-size: 1.4rem; color: var(--accent-secondary); margin-bottom: 15px; text-transform: capitalize; }
p, li { font-family: 'Roboto', sans-serif; font-size: 1.05rem; color: var(--text-secondary); margin-bottom: 1rem; transition: color .4s ease; }
a { color: var(--accent-secondary); text-decoration: none; transition: color .3s; }
a:hover { color: var(--accent-primary); }
strong { color: var(--accent-primary); font-weight: 700; }

/* Menu toggle */
.menu-toggle { position: fixed; top: 25px; right: 25px; width: 40px; height: 40px; background: rgba(20,20,20,0.5); backdrop-filter: blur(5px); border-radius: 50%; display: flex; flex-direction: column; justify-content: center; align-items: center; cursor: pointer; z-index: 1001; transition: all .3s ease; border: 0; }
.menu-toggle:hover { background: var(--accent-primary-hover); }
.menu-toggle .bar { width: 20px; height: 2px; background: var(--text-primary); margin: 3px 0; transition: all .3s ease; }
.menu-toggle.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle.active .bar:nth-child(2) { opacity: 0; }
.menu-toggle.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Nav overlay */
.nav-overlay { position: fixed; top: 0; right: 0; width: 320px; height: 100%; background: rgba(10,10,10,0.95); backdrop-filter: blur(15px); z-index: 1000; display: flex; justify-content: center; align-items: center; transform: translateX(100%); transition: transform .5s cubic-bezier(.77,0,.175,1); }
.nav-overlay.active { transform: translateX(0); }
.nav-links { text-align: left; list-style: none; position: relative; padding-left: 40px; }
.nav-links::before { content: ''; position: absolute; left: 0; top: 0; height: 100%; width: 2px; background-color: var(--border-color); }
.nav-links li { margin: 35px 0; opacity: 0; transform: translateX(20px); transition: opacity .5s, transform .5s; position: relative; }
.nav-links li::before { content: '✦'; position: absolute; left: -50px; top: 50%; transform: translateY(-50%); color: var(--accent-primary); font-size: 1.5rem; transition: text-shadow .3s; }
.nav-links li:hover::before { text-shadow: 0 0 10px var(--accent-primary); }
.nav-overlay.active .nav-links li { opacity: 1; transform: translateY(0); }
.nav-overlay.active .nav-links li:nth-child(1) { transition-delay: .2s; }
.nav-overlay.active .nav-links li:nth-child(2) { transition-delay: .3s; }
.nav-overlay.active .nav-links li:nth-child(3) { transition-delay: .4s; }
.nav-overlay.active .nav-links li:nth-child(4) { transition-delay: .5s; }
.nav-overlay.active .nav-links li:nth-child(5) { transition-delay: .6s; }
.nav-links a { font-family: 'Oswald', sans-serif; font-size: 1.8rem; color: var(--text-secondary); font-weight: 700; transition: color .3s; }
.nav-links a:hover { color: var(--accent-primary); }

/* Hero */
.hero { position: relative; height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 20px; margin-bottom: 0; }
.hero-content { position: relative; z-index: 1; }
.hero-title {
    position: relative;
    display: inline-block;
    animation: title-fade-in 1.2s ease-out forwards;
    opacity: 0;
}
@keyframes title-fade-in {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.hero-title::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(100deg, transparent 20%, rgba(255, 215, 0, 0.7) 50%, transparent 80%);
    transform: skewX(-25deg);
    transition: left 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}
.hero-title:hover::after { left: 150%; }
.hero-subtitle { 
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: clamp(1.25rem, 3vw, 1.8rem); 
    color: var(--text-primary); 
    margin-top: 20px;
    font-weight: 400;
    letter-spacing: 1px;
}
.cta-button { 
    display: inline-block; 
    margin-top: 30px; 
    padding: 15px 35px; 
    background-color: var(--accent-primary); 
    color: var(--bg-dark); 
    font-size: 1.1rem; 
    font-weight: 700; 
    text-decoration: none; 
    border-radius: 50px; 
    border: 2px solid var(--accent-primary);
    transition: transform .3s ease, box-shadow .3s ease, background-color .3s ease, color .3s ease; 
}
.cta-button:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 20px rgba(255, 193, 7, 0.2); 
    background-color: transparent;
    color: var(--accent-primary);
}

/* Card */
.card { background-color: rgba(26, 26, 26, 0.68); padding: 35px; border-radius: 12px; border: 1px solid var(--border-color); box-shadow: 0 8px 30px var(--shadow-color); transition: transform .4s ease, box-shadow .4s ease, border-color .3s ease; position: relative; overflow: hidden; will-change: transform; }
.card::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 0; height: 0; background: radial-gradient(circle, rgb(143 109 7 / 15%) 0%, transparent 50%); opacity: 0; transition: width .5s, height .5s, opacity .5s; pointer-events: none; }
.card:hover { 
    transform: scale(1.005);
    box-shadow: 0 12px 40px var(--shadow-color), 0 0 25px rgba(3,169,244,0.2); 
}
.card:hover p, .card:hover li, .card:hover .timeline-details {
    color: #d9d9d9;
}
.card:hover::after { opacity: 1; width: var(--glow-size, 300px); height: var(--glow-size, 300px); }
.grid-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; }
.grid-container .card { text-align: center; }
.grid-container .card .icon { margin: 0 auto 15px; }
.card .icon { width: 50px; height: 50px; margin-bottom: 15px; color: var(--accent-secondary); position: relative; z-index: 1; }
.card h3, .card p, .card ul { position: relative; z-index: 1; }
.card p, .footer-text { text-align: justify;}
.card p.p-center {text-align-last: center;}
.card .book-indent { text-indent: 2.5em; }
.card ul { list-style: none; text-align: left; }
.card ul li { position: relative; padding-left: 28px; }
.card ul li::before { content: '🎬'; position: absolute; left: 0; top: 2px; }
.question-prompt {
    position: relative;
    padding-left: 25px;
    text-align: justify;
}
.question-prompt::before {
    content: '✦';
    color: var(--accent-primary);
    position: absolute;
    left: 0;
    top: -2px;
    font-size: 1.2rem;
}
#intro .card ul {
    list-style: disc;
    padding-left: 40px;
}
#intro .card ul li {
    padding-left: 0;
}
#intro .card ul li::before {
    content: none;
}


/* Timeline */
.timeline-container { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; }
#timeline-svg { position: absolute; inset: 0 auto auto 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
#timeline-path { stroke: url(#path-gradient); stroke-width: 3; fill: none; transition: stroke-dashoffset .5s linear; }
.timeline-item {
    position: relative;
    width: calc(50% - 40px);
    margin-bottom: 50px;
    z-index: 1;
}
.timeline-title {
    margin-bottom: 10px;
}
.timeline-item:nth-child(odd) { align-self: flex-start; }
.timeline-item:nth-child(even) { align-self: flex-end; }
.timeline-content { 
    text-align: center; 
    position: relative;
    padding-top: 40px;
}
.timeline-content.card {
    background-color: var(--bg-card);
}
.timeline-week {
    position: absolute;
    top: -19px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    padding-top: 2px; /* Nudge the number down slightly */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23FFC107'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    font-family: 'Oswald', sans-serif;
    z-index: 2;
    color: var(--bg-dark);
    font-size: 1rem; 
    transition: transform .4s ease;
    transform-origin: center bottom;
}
.timeline-details { font-size: 1rem; color: #cccccc; text-align: center; transition: color .4s ease; }

.timeline-item:hover .timeline-content.card {
    transform: scale(1.005);
    box-shadow: 0 12px 40px var(--shadow-color), 0 0 25px rgba(3,169,244,0.2);
}
.timeline-item:hover .timeline-week {
    transform: translateX(-50%) scale(1.02);
}


/* Form */
#registration-form { background: transparent; padding: 0; border: none; box-shadow: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px 40px; }
.form-group { position: relative; margin-bottom: 40px; }
.form-group.full-width { grid-column: 1 / -1; }

.form-group :is(input, textarea) { width: 100%; padding: 10px 0; border: none; border-bottom: 2px solid var(--border-color); background-color: transparent; color: var(--text-primary); font-size: 1.1rem; transition: border-color .3s ease; }

.form-group :is(input, textarea):focus { outline: none; border-color: var(--accent-secondary); }

.form-group label { position: absolute; top: 10px; left: 0; color: var(--text-secondary); pointer-events: none; transition: all .3s ease; }

.form-group :is(input, textarea, select):focus + label,
.form-group :is(input, textarea):not(:placeholder-shown) + label,
.form-group select:valid + label {
    top: -20px;
    font-size: .9rem;
    color: var(--accent-secondary);
}


.form-group select {
    width: 100%;
    padding: 10px 0;
    border: none;
    border-bottom: 2px solid var(--border-color);
    background-color: transparent;
    color: var(--text-secondary); 
    font-size: 1.1rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 0;
    transition: border-color .3s ease, color .3s ease;
}

.form-group select:focus {
    outline: none;
    border-color: var(--accent-secondary);
}

.form-group select:valid {
    color: var(--text-primary);
}

.form-group.custom-select-wrapper {
    position: relative;
}

.form-group.custom-select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 5px;
    top: 10px;
    font-size: 0.8em;
    color: var(--text-secondary);
    pointer-events: none;
    transition: color .3s ease;
}

.form-group select + label {
    position: absolute;
    top: 10px;
    left: 0;
    color: var(--text-secondary);
    pointer-events: none;
    transition: all .3s ease;
}

.form-group select:focus + label,
.form-group select:valid + label {
    top: -20px;
    font-size: .9rem;
    color: var(--accent-secondary);
}

.form-group select optgroup {
    font-size: 1rem;
    font-weight: bold;
    color: var(--accent-primary);
    background-color: #1a1a1a;
    padding: 10px 8px;
}

.form-group select option {
    background-color: var(--bg-card);
    color: #d9d9d9;
    padding: 10px 12px;
    transition: background-color 0.2s ease;
}

.form-group select option:hover {
    background-color: rgba(3, 169, 244, 0.25);
    color: var(--accent-primary);
}

.form-group textarea { resize: vertical; min-height: 120px; }
.submit-btn { 
    display: block; 
    width: 100%; 
    padding: 18px; 
    background-color: transparent;
    border: 2px solid var(--border-color);
    color: var(--accent-primary);
    border-radius: 8px; 
    font-size: 1.2rem; 
    font-weight: 700; 
    cursor: pointer; 
    transition: color .4s ease, border-color .4s ease, box-shadow .4s ease, opacity .3s ease; 
    font-family: 'Oswald', sans-serif; 
    letter-spacing: 1px; 
    margin-top: 20px; 
    position: relative;
    overflow: hidden;
}

.label-hint {
    font-weight: 400;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.form-hint {
    display: block;
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 10px;
    padding-left: 22px;
    position: relative;
    font-style: italic;
    opacity: 0.9;
}

.form-hint::before {
    content: '✦';
    color: var(--accent-primary);
    position: absolute;
    left: 0;
	top: -2px;
    font-size: 1rem;
    font-style: normal;
}

.submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}
.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: left .8s ease;
}
.submit-btn:not(:disabled):hover { 
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px 5px rgba(255, 193, 7, 0.2);
}
.submit-btn:not(:disabled):hover::before {
    left: 125%;
}

/* Message Modal */
.message-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.message-modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}
.message-modal {
    background-color: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px var(--shadow-color);
    text-align: center; 
    max-width: 90%;
    width: 450px;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.message-modal-overlay.visible .message-modal {
    transform: scale(1);
}
.message-modal-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
}
.message-modal h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}
.message-modal p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}
.message-modal ul {
    list-style-position: inside;
    padding-left: 10px;
    margin-bottom: 30px;
    text-align: left;
}
.message-modal-close {
    display: inline-block;
    padding: 10px 30px;
    background-color: var(--accent-secondary);
    color: var(--text-primary);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.3s;
}
.message-modal-close:hover {
    background-color: #039be5;
}
/* Status-specific colors */
.message-modal.success h3 { color: var(--success-color); }
.message-modal.error h3 { color: var(--error-color); }
.message-modal.loading h3 { color: var(--accent-secondary); }

/* Footer */
.footer-wrapper { position: relative; background-color: #000; }
.footer { background-color: #000; padding: 40px 20px; text-align: center; }
.footer-socials { display: flex; justify-content: center; gap: 30px; margin-bottom: 30px; }
.footer-socials a { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 1rem; }
.footer-socials svg { width: 20px; height: 20px; fill: var(--text-secondary); transition: fill .3s, transform .3s; }
.footer-socials a:hover svg { fill: var(--accent-primary); }
.footer-logo { width: 60px; height: auto; margin: 30px auto; }
.footer-text { max-width: 1200px; margin: 0 auto 30px; text-align: center; }
.footer-groups { display: flex; justify-content: center; gap: 20px; margin: 40px 0; }
.footer-groups a { font-family: 'Oswald', sans-serif; color: var(--text-primary); border: 1px solid var(--border-color); padding: 8px 20px; border-radius: 20px; transition: background-color .3s, border-color .3s; }
.footer-groups a:hover { background-color: var(--accent-primary-hover); border-color: var(--accent-primary-hover); color: var(--bg-dark); }
.footer-hr { border: 0; height: 1px; background-image: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,.1), rgba(255,255,255,0)); max-width: 800px; margin: 30px auto; }
.footer-copyright { margin-top: 40px; font-size: .9rem; color: #d9d9d9; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(50px); transition: opacity .8s ease-out, transform .8s ease-out; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 992px) { .form-grid { grid-template-columns: 1fr; gap: 0; } }

@media (max-width: 768px) {
    .hero { height: 80vh; }
    #timeline-svg { display: none; }
    .timeline-container { 
        display: block; 
        position: relative; 
        padding-left: 0; 
    }
    .timeline-container::before { 
        display: none; 
    }
    .timeline-item { 
        position: relative;
        width: 100%; 
        padding-top: 35px;
        margin-bottom: 25px; 
        align-self: auto !important;
        left: auto !important;
        text-align: center !important;
    }
    .timeline-content { 
        text-align: center;
        padding-top: 35px;
        position: relative;
    }
    
    .timeline-week { 
        position: absolute;
        left: 50%;
        top: 19px;  
        transform: translateX(-50%);
        width: 45px;
        height: 45px;
        z-index: 3;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
    }
}

::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark); 
}

::-webkit-scrollbar-thumb {
  background-color: #444;
  border-radius: 20px;
  border: 3px solid var(--bg-dark); 
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--accent-primary);
}

html {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-primary) var(--bg-dark);
}
