:root {
    --primary-color: #000000;
    --background-color: #ffffff;
    --foreground-color: #f4f4f6;
    --text-color: #21222c;
    --container-width: 1024px;
}

body {
    background: #f8fafc;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif
}

/* Header */
.site-header {
    background: var(--background-color);
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.5rem;
    min-width: 0;
    flex: 1 1 auto;
}

.brand-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-links-wrapper {
    flex-grow: 1;
    display: flex;
    justify-content: end;
    margin-right: 2rem
}

.nav-list {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0
}

.nav-item {
    position: relative
}

.nav-button {
    background: #fff0;
    border: none;
    font-size: 1rem;
    font-family: inherit
}

.nav-button::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease
}

.nav-item:hover .nav-button::after {
    transform: rotate(-135deg)
}

.nav-link,
.nav-button {
    display: flex;
    align-items: center;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0;
    cursor: pointer
}

.nav-link:hover {
    color: var(--primary-color)
}

.submenu {
    position: absolute;
    top: 100%;
    left: 50%;
    background: var(--background-color);
    box-shadow: 0 5px 42px 0 #00000014;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(10px);
    transition: all 0.2s cubic-bezier(.4, 0, .2, 1);
    list-style: none;
    min-width: 220px;
    margin-top: 1rem;
    padding: 10px;
    z-index: 1
}

.submenu::before {
    content: '';
    position: absolute;
    top: -1rem;
    width: 100%;
    height: 1rem
}

.nav-item:hover .submenu,
.nav-item:focus-within .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0)
}

.submenu-link {
    color: var(--text-color);
    padding: .4rem .6rem;
    display: block;
    font-weight: 500;
    text-decoration: none
}

.submenu-link:hover {
    color: var(--primary-color)
}

.nav-button-group {
    order: 3
}

.cta-button {
    padding: .5rem 1.25rem;
    font-weight: 500;
    font-size: .9rem;
    border-radius: .5rem;
    text-decoration: none;
    background-color: var(--primary-color);
    color: var(--background-color);
    box-shadow: 0 1px 2px 0 rgb(37 99 235 / .3)
}

.menu-toggle {
    display: none;
    width: 32px;
    height: 32px;
    align-items: center;
    background: transparent;
    border: none;
    padding: 0;
}

.menu-toggle .icon-bar {
    width: 20px;
    height: 2px;
    background-color: var(--text-color);
    position: relative
}

.menu-toggle .icon-bar::before,
.menu-toggle .icon-bar::after {
    content: "";
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    background-color: var(--text-color);
}

.menu-toggle .icon-bar::before {
    top: -6px
}

.menu-toggle .icon-bar::after {
    top: 6px
}

@media (max-width:768px) {
    .nav-container {
        justify-content: space-between
    }

    .nav-button-group {
        display: flex;
        align-items: center;
        gap: .5rem
    }

    .menu-toggle {
        display: flex;
        justify-content: flex-end;
    }

    .nav-links-wrapper {
        position: fixed;
        top: 0;
        right: 0;
        height: 100%;
        width: 300px;
        margin: 0;
        background: var(--background-color);
        transform: translateX(300px);
        transition: transform 0.3s ease
    }

    .nav-links-wrapper.is-open {
        transform: translateX(0)
    }

    .site-header::before {
        content: "";
        position: fixed;
        inset: 0;
        background-color: #fff0;
        backdrop-filter: blur(0);
        pointer-events: none;
        transition: background-color 0.3s ease, backdrop-filter 0.3s ease
    }

    .site-header:has(.nav-links-wrapper.is-open)::before {
        background-color: rgba(0, 0, 0, .2);
        backdrop-filter: blur(5px);
    }

    body:has(.nav-links-wrapper.is-open) {
        overflow: hidden
    }

    .nav-list {
        flex-direction: column;
        width: 100%;
        padding: 0;
        gap: .75rem
    }

    .nav-item {
        padding: .5rem .5rem .5rem 2rem;
    }

    .nav-list::before {
        content: "NAVIGATION";
        letter-spacing: 5px;
        font-weight: 700;
        background: var(--foreground-color);
        text-align: center;
        padding: 2rem 0;
        color: #6b7280;
    }

    .submenu {
        margin-top: 0;
    }

    .site-header::before,
    .nav-links-wrapper {
        z-index: 999;
    }
}

/* PWA & iOS Toast */
.ios-pwa-toast {
    position: fixed;
    bottom: -110%;
    left: 0;
    right: 0;
    background: #fff;
    padding: 25px;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transition: bottom 0.5s cubic-bezier(0.32, 1, 0.23, 1);
    text-align: center;
}

.ios-pwa-toast.active {
    bottom: 0;
}

.toast-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    z-index: 9999;
    transition: 0.3s;
}

.toast-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ios-icon {
    height: 24px;
    vertical-align: middle;
    margin: 0 4px;
}

body.toast-open {
    overflow: hidden;
}

#pwa-install-btn {
    cursor: pointer;
    border: none;
}



/* Footer Container */
.site-footer {
    background-color: var(--background-color);
    border-top: 1px solid #e5e7eb;
}

.footer-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

.footer-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.copyright {
    color: var(--text-color);
    font-size: 0.875rem;
}

.copyright-brand {
    font-weight: 500;
    text-decoration: none;
}

.footer-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    column-gap: 1.5rem;
}

.footer-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.2s;
    display: inline-block;
    padding: 0.5rem 0;
}

.footer-nav a:hover {
    color: var(--primary-color);
}

@media (max-width:768px) {
    .footer-content {
        flex-direction: column-reverse;
    }

    .footer-nav {
        justify-content: center;
    }

    .copyright {
        margin-bottom: .5rem;
    }
}


/*Threads Downloader Style*/
.glass-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.spinner {
    border: 3px solid rgba(59, 130, 246, 0.1);
    border-top-color: #3b82f6;
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
