* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(104.433deg, rgb(239, 246, 255) 0%, rgb(255, 255, 255) 50%, rgb(250, 245, 255) 100%);
    color: #1d1d1f;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

body.android-theme {
    background: linear-gradient(104.433deg, rgb(239, 246, 255) 0%, rgb(255, 255, 255) 50%, rgb(250, 245, 255) 100%);
}

/* Auth Loading Screen */
.auth-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(104.433deg, rgb(239, 246, 255) 0%, rgb(255, 255, 255) 50%, rgb(250, 245, 255) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.auth-loading-content {
    text-align: center;
}

.auth-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #155dfc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.auth-loading-text {
    font-size: 16px;
    color: #6e6e73;
    font-family: 'Inter', sans-serif;
}

.auth-loading.hidden {
    display: none;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Hide main content until authentication is verified */
#main-content {
    display: none;
}

#main-content.authenticated {
    display: block;
}

/* Header */
.header {
    padding: 20px;
    background: white;
    border-bottom: 1px solid #e5e5e7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6e6e73;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.logout-btn:hover {
    background: #e5e7eb;
    color: #1d1d1f;
}

.logout-btn svg {
    width: 16px;
    height: 16px;
}

.platform-selector {
    display: flex;
    gap: 4px;
    background: white;
    padding: 6px;
    border-radius: 9999px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.platform-btn {
    flex: 1;
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4a5565;
    font-family: 'Inter', sans-serif;
}

.platform-btn.active {
    background: #007aff;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 122, 255, 0.3);
}

.platform-btn.active[data-platform="android"] {
    background: #00a63e;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.platform-btn:hover:not(.active) {
    background: rgba(0, 0, 0, 0.05);
}

/* App Info Section */
.app-info {
    padding: 40px 30px;
    text-align: center;
    background: white;
}

.app-icon-container {
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.app-icon {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 26px;
    border: 1px solid #e5e5e7;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.app-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 26px;
}

.ios-badge {
    position: absolute;
    bottom: -8px;
    right: -8px;
    background: #007aff;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 122, 255, 0.3);
}

.android-badge {
    position: absolute;
    bottom: -8px;
    right: -8px;
    background: #00a63e;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.app-name {
    font-size: 30px;
    font-weight: 400;
    color: #0a0a0a;
    margin-bottom: 8px;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.3955px;
}

.app-description {
    font-size: 14px;
    color: #4a5565;
    margin-bottom: 12px;
    line-height: 1.43;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.1504px;
}

.app-tags {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
}

.tag-latest {
    background: #5ac8fa;
    color: white;
}

.android-theme .tag-latest {
    background: #dcfce7;
    color: #008236;
}

.tag-os {
    background: #f3f4f6;
    color: #364153;
    padding: 6px 12px;
}

.icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
}

/* Latest Version Section */
.latest-version {
    margin: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #007aff 0%, #5856d6 100%);
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.android-theme .latest-version {
    background: linear-gradient(to right, #00a63e 0%, #009689 100%);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.latest-title {
    font-size: 20px;
    font-weight: 400;
    color: white;
    margin-bottom: 8px;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.4492px;
}

.latest-details {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 24px;
}

.android-theme .latest-details {
    color: #dcfce7;
    font-size: 14px;
}

.download-btn-primary {
    background: white;
    color: #007aff;
    border: none;
    padding: 16px 32px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.android-theme .download-btn-primary {
    color: #00a63e;
    border-radius: 9999px;
}

.download-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.download-btn-primary:active {
    transform: translateY(0);
}

/* Version History Section */
.version-history {
    padding: 30px;
    background: white;
}

.section-title {
    font-size: 20px;
    font-weight: 400;
    color: #0a0a0a;
    margin-bottom: 16px;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.4492px;
}

.version-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.version-card {
    background: white;
    border: 1px solid #e5e5e7;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.android-theme .version-card {
    border: 0.579px solid #e5e7eb;
    border-radius: 14px;
    padding: 16.576px;
    overflow: hidden;
}

.android-theme .version-card > div {
    background: #f9fafb;
    border-radius: 14px;
    padding: 16.576px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.version-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.version-title {
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
}

.android-theme .version-title {
    font-size: 18px;
    font-weight: 500;
}

.badge-latest {
    background: #34c759;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

.android-theme .badge-latest {
    background: #dcfce7;
    color: #008236;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 9999px;
}

.version-details {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6e6e73;
    margin-bottom: 16px;
}

.android-theme .version-details {
    font-size: 12px;
    color: #4a5565;
    margin-bottom: 0;
    margin-top: 8px;
}

.download-btn-secondary {
    background: #007aff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.android-theme .download-btn-secondary {
    background: #00a63e;
    border-radius: 9999px;
    width: 100%;
    justify-content: center;
}

.download-btn-secondary:hover {
    background: #0051d5;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.download-btn-secondary:active {
    transform: translateY(0);
}

/* Installation Instructions Section */
.installation-instructions {
    margin: 30px;
    padding: 24px;
    background: #fff4e6;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.instructions-title {
    font-size: 22px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 16px;
}

.instructions-list {
    list-style: none;
    counter-reset: step-counter;
    padding-left: 0;
}

.instructions-list li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 32px;
    margin-bottom: 12px;
    font-size: 16px;
    color: #d2691e;
    line-height: 1.6;
}

.instructions-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: #ff9500;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.instructions-list li:last-child {
    margin-bottom: 0;
}

/* Responsive Design */
@media (max-width: 640px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 16px;
    }

    .app-info {
        padding: 30px 20px;
    }

    .app-name {
        font-size: 28px;
    }

    .latest-version {
        margin: 20px;
        padding: 24px;
    }

    .latest-title {
        font-size: 20px;
    }

    .version-history {
        padding: 20px;
    }

    .section-title {
        font-size: 24px;
    }

    .installation-instructions {
        margin: 20px;
        padding: 20px;
    }
}
