/* ================= Root Variables ================= */
:root {
    --primary: #132043;
    --secondary: #1F4171;
    --accent-yellow: #F8DD50;
    --accent-pink: #F1B4BB;
    --light: #FCF0F0;
}

/* ================= Global ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light);
    color: var(--primary);
    transition: background 0.3s, color 0.3s;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* Progress Scroll Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: var(--accent-yellow);
    width: 0;
    z-index: 2000;
    transition: width 0.2s;
}

/* ================= Navbar ================= */
.navbar {
    position: sticky;
    top: 0;
    background-color: var(--primary);
    padding: 12px 0;
    z-index: 1000;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease;
}

.navbar.scrolled {
    background-color: rgba(19, 32, 67, 0.9);
    backdrop-filter: blur(8px);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-brand {
    font-size: 1.4em;
    font-weight: bold;
    color: var(--accent-yellow);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    position: relative;
    transition: color 0.3s;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: var(--accent-pink);
    transition: width 0.3s;
}

.nav-links a:hover {
    color: var(--accent-yellow);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Burger Menu */
.burger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.burger div {
    width: 25px;
    height: 3px;
    background: var(--accent-yellow);
    border-radius: 5px;
    transition: 0.3s;
}

/* ================= Dark Mode Toggle ================= */
.toggle-dark {
    background: none;
    border: 2px solid var(--accent-yellow);
    color: var(--accent-yellow);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, color 0.3s;
}

.toggle-dark:hover {
    background: var(--accent-yellow);
    color: var(--primary);
}

body.dark-mode {
    background: #1a1a1a;
    color: #eee;
}

body.dark-mode .navbar {
    background: #000 !important;
}

body.dark-mode .program-column {
    background: #2a2a2a;
}

body.dark-mode header::after {
    background: linear-gradient(to bottom, rgba(19, 32, 67, 0) 0%, rgba(26, 26, 26, 1) 100%);
}

/* ================= Header ================= */
header {
    background: linear-gradient(rgba(93, 126, 214, 0.75), rgba(205, 156, 156, 0.75)),
        url('../images/bg-header.jpg') center/cover no-repeat;
    color: var(--light);
    text-align: center;
    padding: 100px 20px 120px;
    position: relative;
    overflow: hidden;
}

header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to bottom, rgba(19, 32, 67, 0) 0%, rgba(252, 240, 240, 1) 100%);
    pointer-events: none;
}

header img.logo {
    width: 150px;
    border-radius: 50%;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

h1 {
    font-size: 2.5em;
    color: var(--accent-yellow);
    margin: 0;
}

.cta-btn {
    margin-top: 20px;
    padding: 12px 24px;
    font-size: 1em;
    font-weight: 600;
    border: none;
    border-radius: 25px;
    background: var(--accent-pink);
    cursor: pointer;
    transition: transform 0.3s, background 0.3s;
}

.cta-btn:hover {
    background: var(--accent-yellow);
    transform: scale(1.05);
}

/* ================= Section ================= */
.section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 20px;
}

.intro h2 {
    color: var(--secondary);
    margin-bottom: 15px;
}

.intro p {
    line-height: 1.8;
    font-size: 1.05em;
}

/* ================= Search Box ================= */
.search-box {
    text-align: center;
    margin-bottom: 40px;
}

.search-container {
    position: relative;
    display: inline-block;
    width: 80%;
    max-width: 500px;
}

.search-container input {
    width: 100%;
    padding: 12px 40px 12px 18px;
    border: 2px solid var(--secondary);
    border-radius: 25px;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-container input:focus {
    border-color: var(--accent-yellow);
    box-shadow: 0 0 8px rgba(248, 221, 80, 0.4);
}

.search-container i {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    color: var(--secondary);
}

/* ================= Program Columns ================= */
.programs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    padding: 0 20px;
}

.program-column {
    padding: 20px;
    border-radius: 15px;
    background: var(--secondary);
    color: var(--light);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}

.program-column:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.3);
}

.program-column h3 {
    margin: 0 0 15px 0;
    font-size: 1.4em;
    color: var(--accent-yellow);
    letter-spacing: 1px;
    text-align: center;
}

.program-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    padding: 12px 15px;
    border-radius: 10px;
    font-weight: 500;
    color: var(--light);
    background: var(--primary);
    text-decoration: none;
    transition: all 0.3s;
}

.program-item:hover {
    background: var(--accent-pink);
    color: var(--primary);
    transform: translateX(5px);
}

.highlight {
    background: var(--accent-yellow);
    color: var(--primary);
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: bold;
}

/* ================= Footer ================= */
footer {
    text-align: center;
    padding: 20px;
    background: var(--primary);
    color: var(--light);
    margin-top: 40px;
    font-size: 0.9em;
}

footer .socials {
    margin: 10px 0;
}

footer .socials a {
    margin: 0 8px;
    font-size: 1.2em;
    color: var(--accent-yellow);
    transition: color 0.3s, transform 0.3s;
}

footer .socials a:hover {
    color: var(--accent-pink);
    transform: scale(1.2);
}

/* ================= Scroll to Top ================= */
.scroll-top {
    position: fixed;
    bottom: 20px;
    left: 20px;
    padding: 12px;
    border-radius: 50%;
    background: var(--accent-yellow);
    color: var(--primary);
    cursor: pointer;
    display: none;
    z-index: 1500;
    font-size: 1.2em;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}

.scroll-top:hover {
    transform: scale(1.1);
}

/* ================= Maskot Floating ================= */
.maskot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 120px;
    cursor: pointer;
    z-index: 3000;
    animation: float 3s ease-in-out infinite;
    transition: transform 0.3s;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.maskot:hover {
    transform: scale(1.1);
    animation-play-state: paused;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* ================= Popup Info ================= */
.popup {
    display: none;
    position: fixed;
    bottom: 150px;
    right: 40px;
    max-width: 320px;
    padding: 20px;
    border-radius: 15px;
    background: #fff;
    color: var(--primary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 3001;
    animation: fadeInScale 0.4s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.popup h3 {
    margin: 0 0 10px;
    color: var(--secondary);
}

.popup p {
    margin: 0 0 10px;
    font-size: 0.9em;
    line-height: 1.6;
}

.popup .close-btn {
    float: right;
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.85em;
    cursor: pointer;
    background: var(--accent-pink);
    color: var(--primary);
    font-weight: 600;
    transition: background 0.3s;
}

.popup .close-btn:hover {
    background: var(--accent-yellow);
}

/* ================= Chat Bubble ================= */
.chat-bubble {
    display: none;
    position: fixed;
    bottom: 150px;
    right: 100px;
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 0.85em;
    background: var(--accent-pink);
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    animation: fadeInOut 5s linear;
    z-index: 2500;
    max-width: 280px;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    10%, 90% { opacity: 1; }
    100% { opacity: 0; }
}

/* ================= Popup Login ================= */
.popup-login {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    overflow: auto;
    z-index: 4000;
}

.popup-login-content {
    width: 90%;
    max-width: 400px;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    background: #fff;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.popup-login-content h2 {
    margin-bottom: 20px;
    color: var(--secondary);
}

.popup-login-content div {
    margin-bottom: 15px;
    text-align: left;
}

.popup-login-content label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--primary);
}

.popup-login-content input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s;
}

.popup-login-content input:focus {
    border-color: var(--accent-yellow);
}

.popup-login-content button {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background 0.3s, transform 0.3s;
}

.popup-login-content button:hover {
    background: var(--secondary);
    transform: scale(1.02);
}

.close-login {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--primary);
    transition: color 0.3s;
}

.close-login:hover {
    color: var(--accent-pink);
}

/* ================= Responsive Design ================= */

/* Tablet */
@media (max-width: 992px) {
    .nav-links {
        gap: 15px;
    }
    
    header {
        padding: 80px 15px 100px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .search-container {
        width: 90%;
    }
    
    .programs {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .section {
        padding: 40px 15px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .burger {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        right: -100%;
        top: 60px;
        flex-direction: column;
        background: var(--primary);
        width: 200px;
        padding: 20px;
        border-radius: 10px 0 0 10px;
        box-shadow: -4px 4px 12px rgba(0, 0, 0, 0.3);
        transition: right 0.4s ease;
        gap: 15px;
    }
    
    .nav-links.show {
        right: 0;
    }
    
    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 10px 0;
    }
    
    .toggle-dark {
        margin-top: 10px;
    }
}

@media (max-width: 576px) {
    .nav-container {
        padding: 0 15px;
    }
    
    .nav-brand {
        font-size: 1.1em;
    }
    
    header {
        padding: 60px 15px 80px;
    }
    
    header img.logo {
        width: 100px;
    }
    
    h1 {
        font-size: 1.5em;
    }
    
    .cta-btn {
        width: 90%;
        padding: 12px;
        font-size: 0.95em;
    }
    
    .intro h2 {
        font-size: 1.3em;
    }
    
    .intro p {
        font-size: 0.95em;
    }
    
    .search-container {
        width: 100%;
    }
    
    .search-container input {
        padding: 10px 40px 10px 15px;
        font-size: 0.9em;
    }
    
    .programs {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 10px;
    }
    
    .program-column {
        padding: 15px;
    }
    
    .program-column h3 {
        font-size: 1.2em;
    }
    
    .program-item {
        padding: 10px 12px;
        font-size: 0.9em;
    }
    
    footer {
        font-size: 0.8em;
        padding: 15px 10px;
    }
    
    footer .socials a {
        font-size: 1.1em;
    }
    
    .maskot {
        width: 80px;
        bottom: 15px;
        right: 15px;
    }
    
    .popup {
        width: 85%;
        right: 7.5%;
        bottom: 100px;
        padding: 15px;
        max-width: none;
    }
    
    .popup h3 {
        font-size: 1.1em;
    }
    
    .popup p {
        font-size: 0.85em;
    }
    
    .chat-bubble {
        bottom: 110px;
        right: 50%;
        transform: translateX(50%);
        width: 85%;
        max-width: 280px;
        text-align: center;
        font-size: 0.8em;
    }
    
    .scroll-top {
        width: 40px;
        height: 40px;
        padding: 8px;
        font-size: 1em;
        bottom: 15px;
        left: 15px;
    }
    
    .popup-login-content {
        width: 90%;
        padding: 20px;
        margin: 20% auto;
    }
    
    .popup-login-content h2 {
        font-size: 1.3em;
    }
}