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

:root {
    --bg: #ffffff;
    --text: #1a1a1a;
    --text-secondary: #666666;
    --card-bg: #f5f5f5;
    --card-border: #e0e0e0;
    --card-hover: #ebebeb;
    --link: #0066cc;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a1a1a;
        --text: #f0f0f0;
        --text-secondary: #a0a0a0;
        --card-bg: #2a2a2a;
        --card-border: #3a3a3a;
        --card-hover: #333333;
        --link: #4da6ff;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Landing Page - Dark Blue Theme */
body.landing-page {
    background: #0a1628;
    color: #e8f0f8;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.landing {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.landing h1 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 3rem;
    color: #8ba4c4;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 700px;
}

@media (max-width: 600px) {
    .project-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .landing h1 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
}

/* Tooltip Wrapper */
.tooltip-wrapper {
    position: relative;
}

.tooltip-wrapper::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -45px;
    left: 50%;
    transform: translateX(-50%);
    background: #0d2240;
    color: #c8d8e8;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10;
    border: 1px solid #1e3a5f;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tooltip-wrapper:hover::after {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 600px) {
    .tooltip-wrapper::after {
        font-size: 0.75rem;
        padding: 6px 10px;
        bottom: -40px;
        white-space: normal;
        width: max-content;
        max-width: 200px;
        text-align: center;
    }
}

/* Project Cards - Landing Page Blue Theme */
body.landing-page .project-card {
    background: #1e3a5f;
    border: 1px solid #2a4a6f;
    border-radius: 16px;
    padding: 1.5rem;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    aspect-ratio: 1;
    min-width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.landing-page .project-card:hover {
    transform: translateY(-4px);
    background: #254a70;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body.landing-page .project-logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: #e8f0f8;
    text-align: center;
}

.project-icon {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 22px;
}

/* Landing Page Support Section */
.support-section-landing {
    margin-top: 60vh;
    width: 100%;
    max-width: 600px;
    text-align: center;
    padding-bottom: 4rem;
}

.support-section-landing h2 {
    font-size: 1.5rem;
    font-weight: 400;
    color: #8ba4c4;
    margin-bottom: 1.5rem;
}

/* Landing Page Contact Form - Dark Blue Theme */
.support-section-landing .contact-form {
    text-align: left;
}

@media (max-width: 600px) {
    .support-section-landing {
        margin-top: 50vh;
        width: 95%;
    }

    .support-section-landing h2 {
        font-size: 1.25rem;
    }
}

/* Scroll Indicator */
.scroll-indicator {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    color: #8ba4c4;
    opacity: 0.7;
    z-index: 100;
    animation: bounce 2s ease-in-out infinite;
    transition: opacity 0.3s ease;
}

body.scrolled .scroll-indicator {
    opacity: 0;
    pointer-events: none;
}

@keyframes bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(8px);
    }
}

/* Default Project Card (for non-landing pages if needed) */
.project-card {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    aspect-ratio: 1;
    min-width: 150px;
}

.project-card:hover {
    transform: translateY(-4px);
    background: var(--card-hover);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    .project-card:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    }
}

.project-logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
}

/* App Detail Page */
.app-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem;
    padding-bottom: 4rem;
}

.back-link {
    display: inline-block;
    color: var(--link);
    text-decoration: none;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.back-link:hover {
    text-decoration: underline;
}

.app-header {
    text-align: center;
    margin-bottom: 3rem;
}

.app-icon-large {
    width: 180px;
    height: 180px;
    object-fit: contain;
    border-radius: 40px;
    margin-bottom: 1.5rem;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.app-description {
    margin-bottom: 3rem;
}

.app-description p {
    margin-bottom: 1rem;
}

.app-description ul {
    margin-top: 1.5rem;
    padding-left: 1.5rem;
}

.app-description li {
    margin-bottom: 0.5rem;
}

.privacy-section,
.support-section {
    margin-bottom: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
}

.privacy-section h2,
.support-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.privacy-section p {
    margin-bottom: 1rem;
}

.last-updated {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
}

.support-section p {
    margin-bottom: 1.5rem;
}

/* Contact Form - Shared Styles */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.submit-btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.submit-btn:hover {
    transform: translateY(-1px);
}

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

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.submit-btn.loading {
    position: relative;
    color: transparent;
}

.submit-btn.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.form-message {
    display: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
}

/* Landing Page Form - Dark Blue Theme */
body.landing-page .form-group label {
    color: #8ba4c4;
}

body.landing-page .form-group input,
body.landing-page .form-group textarea {
    background: #0d2240;
    border: 1px solid #2a4a6f;
    color: #e8f0f8;
}

body.landing-page .form-group input::placeholder,
body.landing-page .form-group textarea::placeholder {
    color: #5a7a9a;
}

body.landing-page .form-group input:focus,
body.landing-page .form-group textarea:focus {
    border-color: #4a7aaf;
    box-shadow: 0 0 0 3px rgba(74, 122, 175, 0.2);
}

body.landing-page .submit-btn {
    background: #2a5a8f;
    color: #e8f0f8;
}

body.landing-page .submit-btn:hover {
    background: #3a6a9f;
}

body.landing-page .submit-btn.loading::after {
    border-top-color: #e8f0f8;
}

/* App Page Form - Light/Dark Theme */
.app-page .form-group input,
.app-page .form-group textarea {
    background: var(--bg);
    border: 1px solid var(--card-border);
    color: var(--text);
}

.app-page .form-group input:focus,
.app-page .form-group textarea:focus {
    border-color: var(--link);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.app-page .submit-btn {
    background: var(--link);
    color: #ffffff;
}

.app-page .submit-btn:hover {
    background: #0055aa;
}

@media (prefers-color-scheme: dark) {
    .app-page .form-group input:focus,
    .app-page .form-group textarea:focus {
        box-shadow: 0 0 0 3px rgba(77, 166, 255, 0.2);
    }

    .app-page .submit-btn:hover {
        background: #5ab0ff;
    }
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .app-page {
        padding: 1.5rem;
    }

    .app-icon-large {
        width: 140px;
        height: 140px;
        border-radius: 32px;
    }

    .app-header h1 {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1.1rem;
    }
}
