@import url("https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");

/* ── Lazy Reveal (shared across pages) ── */
.lazy-pending {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.lazy-pending.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

body {
    font-family: "Segoe UI", sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.container {
    max-width: 1200px;
    margin: auto;
}

header,
main,
footer {
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    height: 50px;
    background-color: var(--nav-bg);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    border-radius: 0 0 50px 50px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

.header-scrolled {
    background-color: var(--nav-bg);
    box-shadow: 0 4px 6px var(--shadow-color);
    padding: 10px 80px 10px 50px;
}

header h1 {
    font-size: 2rem;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    z-index: 2;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    text-align: center;
}

nav ul li {
    position: relative;
    border-radius: 5px;
    padding: 2px;
}

nav a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: bold;
    font-size: 15px !important;
}

nav ul li:hover {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

nav ul li.active {
    border-bottom: 2px solid var(--accent-color);
}

nav ul li.active a {
    color: var(--text-primary);
    pointer-events: none;
    /* font-weight: 500; */
    /* font-style: italic; */
}

/* Override pointer-events: none for megamenu items when the dropdown is open */
nav ul li.media-dropdown.is-open .media-megamenu__item {
    pointer-events: auto;
}

/* Active state: blue bottom border when on Gallery/Vlog/Music page — toggle via is-open */
nav ul li.media-dropdown.active {
    border-bottom: 2px solid var(--accent-color);
    border-radius: 5px;
}

/* Show megamenu only via is-open class (JS toggle); 'active' only gives the underline */
nav ul li.media-dropdown.is-open .media-megamenu {
    display: flex;
}

/* Megamenu items must be clickable when is-open or active */
nav ul li.media-dropdown.is-open .media-megamenu__item,
nav ul li.media-dropdown.active .media-megamenu__item {
    pointer-events: auto;
}

/* ============================
   MEDIA DROPDOWN — Desktop
   ============================ */
.media-dropdown {
    position: relative;
}

.media-dropdown-trigger {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary, #fff);
    font-weight: bold;
    font-size: 15px !important;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px;
    border-radius: 5px;
    width: 100%;
}

.media-dropdown-trigger:hover {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.media-dropdown-trigger ion-icon:last-child {
    font-size: 12px;
    transition: transform 0.25s ease;
}

.media-dropdown.is-open .media-dropdown-trigger ion-icon:last-child {
    transform: rotate(180deg);
}

.media-megamenu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    display: none;
    flex-direction: column;
    gap: 2px;
    min-width: 180px;
    padding: 8px 6px;
    border-radius: 10px;
    background: var(--card-bg, #1e1e1e);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
    z-index: 100;
}

/* Arrow pointing UP toward the "Media" nav item */
.media-megamenu::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 9px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 1px;
}

.media-megamenu::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 21px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--card-bg, #1e1e1e);
}

.media-dropdown:hover .media-megamenu,
.media-dropdown:focus-within .media-megamenu {
    /* disabled — megamenu is shown only via .is-open JS toggle */
    display: none;
}

.media-dropdown.is-open .media-megamenu {
    display: flex;
}

.media-megamenu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary, #fff);
    font-size: 14px;
    font-weight: 600;
    transition: background 0.18s ease, color 0.18s ease;
    white-space: nowrap;
}

.media-megamenu__item ion-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.media-megamenu__item:hover {
    background: rgba(41, 98, 255, 0.12);
    color: var(--accent-color, #2962ff);
}

.media-megamenu__item:last-child {
    padding-bottom: 0;
}

/* ============================
   MOBILE MEDIA SUBMENU
   ============================ */
.mobile-media-dropdown > button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary, #fff);
    font-size: 16px;
    font-weight: bold;
    padding: 0;
    width: 100%;
}

.mobile-media-chevron {
    margin-left: auto;
    transition: transform 0.25s ease;
}

.mobile-media-dropdown.is-open > button .mobile-media-chevron {
    transform: rotate(180deg);
}

.mobile-media-submenu {
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 10px 0 0;
    list-style: none;
    margin: 4px 0 0;
}

.mobile-media-submenu li:last-child {
    padding-bottom: 0;
}

/* Mobile sidebar media dropdown - no extra gap when open */
.sidebar .mobile-media-dropdown.is-open {
    padding-bottom: 0;
}

.sidebar .mobile-media-submenu li:last-child {
    padding-bottom: 0;
}

.mobile-media-submenu li:last-child a {
    padding-bottom: 0;
}

.mobile-media-submenu li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary, #fff);
    text-decoration: none;
    transition: background 0.18s ease;
}

.mobile-media-submenu li a:hover {
    background: rgba(255, 255, 255, 0.06);
}

.mobile-media-submenu li.active a {
    color: var(--accent-color, #2962ff);
}

.cta-button {
    display: inline-block;
    padding: 5px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: #0056b3;
}

footer {
    position: relative;
    display: grid;
    grid-template-rows: auto auto;
    gap: 10px;
    justify-items: center;
    align-items: center;
    padding: 20px 0;
    font-size: 0.9rem;
    color: #666;
}

section {
    margin: 50px 0;
    padding: 20px;
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow-color);
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

section h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

section p {
    font-size: 1rem;
    margin: 5px 0;
}

.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

#animated-heading {
    font-size: 2.5rem;
    font-weight: bold;
    position: relative;
    display: inline-block;
}

#animated-heading::after {
    content: "";
    width: 2px;
    height: 100%;
    background: black;
    display: inline-block;
    position: absolute;
    right: 0;
    animation: blink 0.7s step-end infinite;
}

.language-selector {
    margin-left: auto;
    display: flex;
}

.dropdown {
    position: relative;
}

.dropbtn {
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.flag-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: transform 0.3s;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.dropdown-content .flag-icon {
    margin-right: 10px;
}

.dropdown-content a {
    color: black;
    padding: 8px;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.dropdown-content a:hover,
.dropdown-content a.active {
    background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content {
    transition: visibility 0.3s, opacity 0.3s;
}

.mobile-concern-btn {
    display: none;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

nav #navList {
    cursor: pointer;
}

.language-selector .dropdown-content a {
    font-size: 15px;
}

.donation-btn {
    margin-right: 15px;
}

.nav-toggle {
    display: none;
}

.chatbox-icon,
.nav-toggle,
#navList,
.carousel-card,
.gallery-item {
    user-select: none;
}

.project-intro,
#about,
#resume,
#contact,
.gallery-item {
    position: relative !important;
}

.voice-icon {
    position: absolute;
    width: 40px;
    height: 40px;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.3s ease;
    bottom: 0;
    right: 0;
    margin: 10px;
}

.voice-icon.active {
    opacity: 0.5;
    transform: scale(1.1);
    transition: all 0.2s;
    animation: mic-wave 1.5s infinite;
}

.voice-icon:hover {
    transform: scale(1.1);
    animation: mic-wave 1.5s infinite;
}

@keyframes mic-wave {
    0% {
        box-shadow: 0 0 0 0px rgba(0, 123, 255, 0.8);
    }

    50% {
        box-shadow: 0 0 0 20px rgba(0, 123, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0px rgba(0, 123, 255, 0);
    }
}

.disabled-btn {
    background-color: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
    border-color: transparent !important;
}

.media-dropdown:hover,
.media-dropdown.is-open {
    opacity: 1 !important;
}

@media (max-width: 1400px) {
    .dropdown-content {
        right: 0;
    }
}

/* Mobile (≤768px): show submenu via JS is-open class only — no :focus interference */
@media (max-width: 768px) {
    .mobile-media-dropdown.is-open .mobile-media-submenu {
        display: flex;
        padding-left: 20px;
        padding-top: 10px;
    }

    .mobile-media-dropdown.is-open .mobile-media-submenu li {
        padding: 0 !important;
    }

    .mobile-media-dropdown.is-open > button .mobile-media-chevron {
        transform: rotate(180deg);
    }

    .mobile-media-dropdown > button {
        padding-left: 20px !important;
    }

    button,
    a,
    input,
    textarea {
        -webkit-tap-highlight-color: transparent;
    }

    button,
    a,
    input,
    textarea {
        outline: none;
    }

    button:focus,
    a:focus,
    input:focus,
    textarea:focus {
        outline: none;
        box-shadow: none;
    }

    nav {
        display: flex;
        align-items: center;
        position: relative;
    }

    nav ul li,
    .language-selector .dropdown-content a {
        font-size: 14px;
    }

    nav ul li:hover::after {
        width: 0%;
    }

    nav ul li:hover {
        background-color: var(--nav-bg);
    }

    .nav-toggle {
        display: block;
        cursor: pointer;
        font-size: 30px;
        margin-bottom: 3px;
    }

    /* Hide desktop megamenu on mobile — mobile uses .mobile-media-dropdown with JS toggle */
    .media-megamenu {
        display: none;
    }

    nav #navList {
        display: none;
        /* Hide the navigation by default */
        flex-direction: column;
        /* Change to row direction */
        flex-wrap: wrap;
        /* Allow items to wrap */
        width: auto;
        /* Full width */
        padding: 0;
        /* Remove padding */
        margin: 0;
        /* Remove margin */
        position: absolute;
        top: 50px;
        background-color: var(--bg-primary);
        z-index: 1000;
        border-radius: 8px;
        gap: 0px;
        box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    }

    nav #navList.show {
        display: flex;
        /* Show when toggled */
    }

    nav #navList li {
        padding: 10px 20px;
    }

    nav a {
        padding: 10px 20px;
        text-align: left;
        width: 100%;
    }

    .project-intro {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .project-image img {
        max-width: 100%;
        /* Responsive image */
        height: auto;
        margin-bottom: 20px;
        /* Space below the image */
    }

    .project-details {
        max-width: 100%;
        /* Allow full width */
    }

    section h2 {
        font-size: 1.8rem;
        /* Smaller font size for headings */
    }

    .dropdown-content {
        overflow-y: hidden;
        /* Disable vertical scrolling */
    }

    .dropdown-content a {
        padding: 10px;
        width: auto;
    }

    .dropdown-content a img {
        width: 30px;
        height: 30px;
    }

    .mobile-concern-btn {
        display: block;
        padding: 10px;
        background-color: #007bffd2;
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        font-size: 12px !important;
        transition: background-color 0.3s;
    }

    .mobile-concern-btn:hover {
        background-color: #0056b3;
    }

    .language-selector {
        display: flex;
        align-items: center;
        gap: 0;
    }

    .dropdown {
        margin-top: 2px;
    }

    .donation-btn {
        margin-right: 0;
    }

    .donation-btn img {
        width: 40px;
        height: 40px;
    }

    .voice-icon {
        top: 0;
        right: 0;
    }

    .header-scrolled {
        padding: 5px 18px;
    }

    .theme-switch {
        left: 10px;
        padding: 8px;
    }

    .theme-toggle {
        font-size: 20px;
    }

    .mobile-media-submenu li a {
        padding: 15px 10px;
    }

    .mobile-media-submenu a {
        font-size: 15px !important;
    }

    .mobile-media-submenu a ion-icon {
        font-size: 18px !important;
    }
}

/* Additional Responsive Styles */
@media (max-width: 480px) {
    header h1 {
        font-size: 2rem !important;
        /* Smaller header size for small screens */
    }
}

.theme-toggle {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    font-size: 24px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

[data-theme='light'] .dark-icon {
    display: none;
}

[data-theme='dark'] .light-icon {
    display: none;
}

/* Add this to your existing theme-related styles */
[data-theme='dark'] .donation-btn .flag-icon {
    filter: invert(1) brightness(100%);
    /* This will make the black icon appear white */
}

footer {
    position: relative;
    display: grid;
    grid-template-rows: auto auto;
    gap: 10px;
    justify-items: center;
    align-items: center;
    padding: 20px 0;
}

#copyright {
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: -250px;
    top: 0;
    width: 250px;
    height: 100vh;
    background: var(--bg-primary) !important;
    backdrop-filter: blur(10px);
    transition: 0.3s ease-in-out;
    z-index: 1001;
    padding-top: 60px;
}

#mobileNavList {
    display: grid;
    gap: 10px;
    padding: 0 20px;
}

#mobileNavList li a {
    display: flex;
    align-items: center;
    gap: 15px;
}

#mobileNavList li a ion-icon, .mobile-media-dropdown > button ion-icon {
    font-size: 24px;
    min-width: 24px;
}

.sidebar.active {
    left: 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
}

.nav-toggle {
    z-index: 1002;
    cursor: pointer;
    transition: 0.3s ease-in-out;
}

.nav-toggle .navbar-toggle-icon,
.nav-toggle ion-icon.nav-toggle-icon {
    font-size: 24px;
    color: var(--text-primary);
    font-weight: bold;
}

.nav-toggle.active {
    left: 270px;
}

.sidebar ul {
    padding: 0;
    margin: 0;
}

.sidebar ul li {
    list-style: none;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.3s ease;
}

/* Make the Media button span the full width inside the padded <li> */
.mobile-media-dropdown {
    padding: 10px 20px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-media-dropdown > button {
    width: 100%;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary, #fff);
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar ul li:hover {
    background: rgba(255, 255, 255, 0.1);
    padding-left: 30px;
}

.sidebar ul li a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 16px;
    display: block;
}

/* Desktop Navigation */
nav #navList {
    display: flex;
    list-style: none;
    gap: 20px;
    margin: 0;
    padding: 0;
}

nav #navList li {
    position: relative;
}

nav #navList li a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 16px;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

/* Remove the sidebar styles for desktop */
.sidebar {
    display: none;
}

.admin-float-btn {
    position: fixed;
    top: 50%;
    left: -3%;
    transform: translateY(-50%);
    background: #007bff;
    color: white;
    width: 130px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 16px;
    font-weight: 500;
    border-radius: 0 25px 25px 0;
    padding-right: 18px;
    box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    text-decoration: none;
    z-index: 9999;
    overflow: visible;
    transition: all 0.3s ease;
    /* Hidden while page loading overlay is visible */
    visibility: hidden;
}

/* Show the admin float button once page load is complete */
body.loading-done .admin-float-btn {
    visibility: visible;
}

/* Hover animation */
.admin-float-btn:hover {
    background: #0056b3;
}

/* Icon inside */
.admin-float-btn ion-icon {
    font-size: 20px;
    margin-left: 12px;
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.admin-float-btn:hover ion-icon {
    transform: rotate(90deg);
}

/* Label text (optional) */
.admin-float-btn span {
    font-weight: 600;
    font-size: 14px;
}

/* Mobile Navigation */
@media only screen and (max-width: 768px) {
    body.loading-done .admin-float-btn {
        visibility: hidden;
    }

    .admin-float-btn {
        top: auto;
        bottom: 15px;
        left: 15px;
        transform: none;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        justify-content: center;
        text-align: center;
        padding: 0;
        visibility: hidden;
    }

    .admin-float-btn ion-icon {
        font-size: 22px;
        margin: 0;
    }

    .admin-float-btn::before {
        display: none;
    }

    .admin-float-btn:hover {
        transform: scale(1.1);
    }

    .admin-float-btn span {
        display: none;
    }

    body.nav-active .admin-float-btn {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    nav #navList {
        display: none;
        /* Hide desktop nav */
    }

    nav ul {
        gap: 0 !important;
    }

    .sidebar {
        display: block;
        position: fixed;
        left: -250px;
        top: 0;
        width: 250px;
        height: 100vh;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
        transition: 0.3s ease-in-out;
        z-index: 1001;
        padding-top: 60px;
    }

    .sidebar.active {
        left: 0;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
    }

    .sidebar #navList {
        display: flex !important;
        flex-direction: column;
        padding: 0;
        margin: 0;
    }

    .nav-toggle {
        display: block;
    }

    .sidebar ul li, .sidebar ul li:hover {
        padding-left: 0 !important;
    }
}

/* =============================================
    PAGE LOADING OVERLAY — 3-dot wave animation
   ============================================= */

#pageLoadingOverlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease;
}

/* Light theme — white bg, black dots */
[data-theme="light"] #pageLoadingOverlay {
    background-color: #ffffff;
}

/* Dark theme — black bg, white dots */
[data-theme="dark"] #pageLoadingOverlay {
    background-color: #111111;
}

/* Fallback when no theme attr (defaults to light) */
#pageLoadingOverlay {
    background-color: #ffffff;
}

/* Three dots wrapper — horizontal */
.loading-dots-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Each dot */
.loading-dot {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    animation: wave-dot 1.2s ease-in-out infinite;
}

/* Light theme dots */
[data-theme="light"] .loading-dot {
    background-color: #222222;
}

/* Dark theme dots */
[data-theme="dark"] .loading-dot {
    background-color: #eeeeee;
}

/* Fallback */
.loading-dot {
    background-color: #222222;
}

/* Dot 2 and 3 delayed by 0.2s each */
.loading-dot-2 { animation-delay: 0.2s; }
.loading-dot-3 { animation-delay: 0.4s; }

/* Wave keyframe: bouncy up-and-down */
@keyframes wave-dot {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    40% {
        transform: translateY(-18px);
        opacity: 1;
    }
}

/* Hide overlay when page is done loading */
#pageLoadingOverlay.loaded {
    opacity: 0;
    pointer-events: none;
}

/* Suppress Ion Icons default SVG title tooltips */
ion-icon { pointer-events: none !important; }
