/* Index.css Global Variables */
:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --primary-color: #007aff;
    --accent-color: #007aff;
    --header-height: 50px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #000000;
        --text-color: #f5f5f5;
        --primary-color: #007aff;
        --accent-color: #007aff;
    }
}

[data-theme="light"] {
    --bg-color: #ffffff;
    --text-color: #000000;
    --primary-color: #007aff;
    --accent-color: #007aff;
}

[data-theme="dark"] {
    --bg-color: #000000;
    --text-color: #f5f5f5;
    --primary-color: #007aff;
    --accent-color: #007aff;
}

/* Global Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.5;
    padding-top: var(--header-height);
    margin: 0;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Header Styles */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-color);
    padding: 0 15px;
    margin: 0;
    z-index: 1000;
    border-bottom: 1px solid transparent;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    height: var(--header-height);
    box-sizing: border-box;
}

[data-theme="light"] #main-header {
    border-bottom-color: #eeeeee;
}
[data-theme="dark"] #main-header {
     border-bottom-color: #222222;
}

#main-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    margin: 0 auto;
    gap: 1.5rem;
    position: relative;
}

#main-header .header-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

#main-header nav a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

#main-header nav a:hover,
#main-header nav a:focus {
    color: var(--accent-color);
    text-decoration: none;
    outline: none;
}

/* Styles for the theme switch *inside* the header */
#main-header .theme-switch-wrapper {
    display: flex;
    align-items: center;
    padding: 0;
    background-color: transparent;
}

#main-header .theme-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1px;
}

#main-header .theme-switch-wrapper i {
    font-size: 1.2rem;
    transition: opacity 0.3s ease;
    line-height: 1;
}

#main-header .theme-toggle:hover {
    opacity: 0.5;
}

#main-header .theme-toggle:focus {
    outline: none;
}

#main-header .theme-toggle .fa-sun {
    display: none;
}

#main-header .theme-toggle .fa-moon {
    display: inline-block;
    color: #007aff;
}

[data-theme="dark"] #main-header .theme-toggle .fa-sun {
    display: inline-block;
    color: #FFA500;
}

[data-theme="dark"] #main-header .theme-toggle .fa-moon {
    display: none;
}

.logo {
    width: 70px;
    height: auto;
}

.logo-light {
    display: none;
}

.logo-dark {
    display: inline;
}

@media (prefers-color-scheme: light) {
    .logo-light {
        display: inline;
    }
    .logo-dark {
        display: none;
    }
}

[data-theme="light"] .logo-light {
    display: inline;
}

[data-theme="light"] .logo-dark {
    display: none;
}

[data-theme="dark"] .logo-light {
    display: none;
}

[data-theme="dark"] .logo-dark {
    display: inline;
}

/* Main Content - contains screenshot and description sections */
main {
    display: flex;
    max-width: 100%;
    justify-content: center;
}

.content {
    flex: 0 0 50%;
    max-width: calc(50% - 4rem);
}

/* Section Styles - contains descriptions */
section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 2rem;
    gap: 0.5rem;
}

/* Typography Styles */
h1, h2 {
    font-size: 3rem;
    color: #007AFF;
    margin: 0;
}

h3 {
    font-size: 1.5rem;
    margin: 0;
}

a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover, a:focus {
    color: var(--accent-color);
}

*:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* App Store Button Styles */
.app-store-buttons {
    display: flex;
    gap: 2rem;
    margin: 1rem 0;
}

.app-store-button img {
    height: 3rem;
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 0;
    border-top: 1px solid #f0f0f0;
    background-color: var(--bg-color);
}

footer a {
    color: var(--text-color);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
}

.footer-text {
    font-size: 0.9rem;
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}

.copyright-text {
    font-size: 0.9rem;
    display: flex;
    text-align: center;
}

/* App Preview Styles - using screenshots */
.app-preview {
    --phone-width: min(90vw, 40vh);
    flex: 0 0 var(--phone-width);
    position: sticky;
    top: 3rem;
    height: calc(100vh - 3rem - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.app-preview img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.75s ease;
    transform: translateX(100%);
}

.app-preview img.active {
    opacity: 1;
    transform: translateX(0);
}

/* Media query for tablet screens */
@media (max-width: 1024px) {
    h1, h2 {
        font-size: 2rem;
    }

    h3 {
        font-size: 1rem;
    }

    .app-store-buttons {
        gap: 1rem;
    }

    .app-store-button img {
        height: 2.5rem;
    }

    .app-preview {
        --phone-width: min(80vw, 35vh);
    }

    .page-content section {
        padding: 0;
    }

    #main-header nav {
        gap: 1rem;
    }
    #main-header .header-links {
        gap: 1rem;
    }
}

/* Media Query - for small screens */
@media (max-width: 450px) and (max-height: 1000px) {
    /* Mobile Header Layout */
    #main-header nav {
        justify-content: space-between;
    }

    #main-header .header-links {
        justify-content: center;
        gap: 1rem;
        flex-wrap: wrap;
    }

    main {
        flex-direction: column;
        align-items: center;
        margin-top: 55vh;
    }

    .content {
        flex: 1;
        max-width: 100%;
        margin-top: 1rem;
        overflow-y: visible;
    }

    section {
        align-items: center;
        min-height: auto;
        text-align: center;
        justify-content: flex-start;
        margin: 2rem 1rem 9rem 1rem;
        gap: 0.5rem
    }

    .page-content ol {
        padding-left: 30px;
    }

    .page-content ul {
        padding-left: 30px;
    }

    h1, h2 {
        font-size: 1.5rem;
        text-align: center;
    }

    h3 {
        font-size: 0.8rem;
        text-align: center;
        margin: 0;
    }

    .app-preview {
        --phone-width: 90vw;
        position: fixed;
        top: var(--header-height);
        left: 50%;
        transform: translateX(-50%);
        width: var(--phone-width);
        height: 60vh;
        background-color: var(--bg-color);
        z-index: 10;
    }

    /* App Store Button Styles */
    .app-store-buttons {
        display: flex;
        gap: 0.5rem;
        justify-content: center;
    }

    .app-store-button img {
        height: 2rem;
    }

    .footer-text {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Media Query - for extremely small screens */
@media (max-width: 370px) and (max-height: 750px) {
    h1, h2 {
        font-size: 1.2rem;
        text-align: center;
    }

    h3 {
        font-size: 0.75rem;
        text-align: center;
        margin: 0;
    }
}

/* Text Pages */
.page-content {
    margin-top: 0;
    padding: 1rem;
    display: block;
}

.page-content section {
    min-height: auto;
    display: block;
    margin: 0;
    padding: 0;
    justify-content: flex-start;
    text-align: left;
}
