:root[data-theme="dark"] {
    --bg-color: #000000;
    --text-color: #ffffff;
    --nav-bg: rgba(28, 28, 30, 0.9);
    --border-color: #38383a;
    --section-bg: rgba(28, 28, 30, 0.8);
    --section-text: #98989d;
    --icon-filter: invert(1);
    --button-bg: #0a84ff;
    --button-hover: #0071e3;
}

:root[data-theme="light"] {
    --bg-color: #f2f2f7;
    --text-color: #000000;
    --nav-bg: rgba(255, 255, 255, 0.9);
    --border-color: rgba(60, 60, 67, 0.1);
    --section-bg: rgba(255, 255, 255, 0.8);
    --section-text: #666666;
    --icon-filter: invert(0);
    --button-bg: #007AFF;
    --button-hover: #0056b3;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Icons', 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    padding-bottom: 100px; /* Space for footer */
    position: relative;
}

nav {
    background-color: var(--nav-bg);
    padding: max(1rem, env(safe-area-inset-top)) 1rem 1rem;
    position: fixed;
    width: 100%;
    height: auto;
    min-height: 44px;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 0.5px solid var(--border-color);
    box-sizing: border-box;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    gap: 16px;
}

nav ul li {
    margin: 0;
}

nav ul li a {
    text-decoration: none;
    color: var(--button-bg);
    font-size: 17px;
    font-weight: 400;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

nav ul li a:active {
    opacity: 0.7;
}

#theme-toggle img {
    filter: var(--icon-filter);
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 120px auto 40px;
    padding: 0 24px;
    box-sizing: border-box;
}

footer {
    background-color: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    text-align: center;
    font-size: 14px;
    border-top: 1px solid var(--border-color);
    z-index: 1000;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--text-color);
}

.header p {
    font-size: 18px;
    color: var(--section-text);
    margin: 0;
}

.download-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    margin: 0 auto;
}

.platform-section {
    background: var(--section-bg);
    border-radius: 20px;
    padding: 32px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
}

.platform-section:hover {
    transform: translateY(-5px);
}

.platform-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 24px;
    filter: var(--icon-filter);
}

.platform-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-color);
}

.download-grid {
    display: grid;
    gap: 24px;
}

.download-card {
    background: var(--nav-bg);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.download-card h3 {
    font-size: 20px;
    margin: 0 0 12px;
    color: var(--text-color);
}

.download-card p {
    font-size: 16px;
    color: var(--section-text);
    margin: 0 0 20px;
}

.btn-container {
    display: flex;
    justify-content: center;
}

.download-btn {
    background: var(--button-bg);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

.download-btn:hover {
    background: var(--button-hover);
}

@media (max-width: 1024px) {
    .download-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
        margin-top: 100px;
    }

    nav ul {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 8px 0;
    }

    nav ul li a {
        font-size: 15px;
        padding: 6px 12px;
    }

    .platform-section {
        padding: 24px;
    }

    .header h1 {
        font-size: 28px;
    }

    .header p {
        font-size: 16px;
    }
}
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
        margin-top: 80px; /* Adjust to prevent overlap with fixed nav */
    }

    nav ul {
        justify-content: flex-start;
        overflow-x: auto;
        white-space: nowrap;
        padding: 8px 0;
    }
    .header{
        margin-top: 174px;
    }

    .header h1 {
        font-size: 24px;
    }

    .header p {
        font-size: 14px;
    }

    .download-container {
        grid-template-columns: 1fr; /* One column for better fit */
        gap: 16px;
    }

    .platform-section {
        padding: 20px;
        border-radius: 12px;
    }

    .platform-title {
        font-size: 20px;
    }

    .platform-icon {
        width: 48px;
        height: 48px;
    }

    .download-card {
        padding: 16px;
        border-radius: 12px;
    }

    .download-card h3 {
        font-size: 18px;
    }

    .download-card p {
        font-size: 14px;
    }

    .download-btn {
        font-size: 14px;
        padding: 8px 16px;
    }

    footer {
        font-size: 12px;
        padding: 12px;
    }
    .theme{
        /*margin-left: 160px;*/
    }
}

/* From Uiverse.io by TCdesign-dev */
.download-btn {
    display: inline-block;
    border-radius: 7px;
    border: none;
    background: #1875FF;
    color: white;
    font-family: inherit;
    text-align: center;
    font-size: 13px;
    box-shadow: 0px 14px 56px -11px #1875FF;
    width: 10em;
    padding: 1em;
    transition: all 0.4s;
    cursor: pointer;
}

.download-btn span {
    cursor: pointer;
    display: inline-block;
    position: relative;
    transition: 0.4s;
}

.download-btn span:after {
    content: 'App';
    position: absolute;
    opacity: 0;
    top: 0;
    right: -20px;
    transition: 0.7s;
}

.download-btn:hover span {
    padding-right: 3.55em;
}

.download-btn:hover span:after {
    opacity: 4;
    right: 0;
}


/* Stick the theme toggle button to the right */
#theme-toggle {
    position: absolute;
    right: 20px; /* Aligns to the right corner */
    top: 50%;
    transform: translateY(-50%);
}
@media (max-width: 768px) {
    #theme-toggle{
        right: 30px;
        transform: translateY(-158%);
    }
    }
