/* ===================================
   Generic Group - Main Stylesheet
   Shared styles for all pages
   =================================== */

/* Base Reset & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

body {
    line-height: 1.6;
    color: #333;
    font-display: swap;
}

/* Layout Components */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.header {
    background-color: #f8f9fa;
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

/* Navigation */
.nav {
    background-color: #fff;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.nav a {
    color: #333;
    text-decoration: none;
    margin: 0 1rem;
    padding: 0.5rem;
}

.nav a:hover {
    color: #007bff;
}

.nav a.current {
    font-weight: bold;
}

[aria-current="page"] {
    font-weight: bold;
    text-decoration: underline;
}

/* Footer */
.footer {
    background-color: #f8f9fa;
    padding: 2rem;
    text-align: center;
    margin-top: 2rem;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* Accessibility - Skip Link */
.skip-link {
    position: absolute;
    top: 0;
    left: 0;
    transform: translateY(-100%);
    background: #007bff;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
    transition: transform 0.3s ease;
    font-weight: 600;
}

.skip-link:focus {
    transform: translateY(0);
    outline: 3px solid #0056b3;
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Focus States */
a:focus, button:focus, input:focus, textarea:focus {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

button:focus-visible {
    outline: 3px solid #0056b3;
    outline-offset: 2px;
}

/* Button Styles */
button {
    padding: 8px 16px;
    min-height: 44px;
    min-width: 44px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #0056b3;
}

/* App Cards (Homepage) */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.app-card {
    background-color: #fff;
    border-radius: 15px;
    padding: 2rem;
    margin: 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    flex: 1;
    min-width: 300px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    color: #333;
}

.app-card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    transform: translateY(-10px);
}

.app-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
    transition: color 0.3s ease;
}

.app-card:hover .app-title {
    color: #007bff;
}

.app-icon {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.app-card:hover .app-icon {
    transform: scale(1.05);
}

.app-card a.card-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.app-store-link {
    display: inline-block;
    position: relative;
    z-index: 3;
}

.app-store-badge {
    display: inline-block;
    margin-top: 1rem;
    transition: transform 0.3s ease;
}

.app-store-badge:hover {
    transform: scale(1.05);
}

.app-store-badge img {
    height: 40px;
    width: auto;
}

/* Ribbons */
.app-card .ribbon {
    position: absolute;
    top: 20px;
    right: -70px;
    width: 220px;
    transform: rotate(45deg);
    padding: 8px;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1;
    background-color: #ff4444;
}

.app-card .ribbon.updated {
    background-color: #007bff;
}

.app-card .ribbon.coming-soon {
    background-color: #28a745;
}

/* Content Sections */
.philosophy-section,
.about-section,
.testimonials {
    padding: 4rem 2rem;
    text-align: center;
    background-color: #f8f9fa;
    margin: 3rem auto;
    border-radius: 10px;
    max-width: 1200px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.philosophy-section h2,
.about-section h2,
.testimonials h2 {
    color: #333;
    margin-bottom: 1.5rem;
}

.philosophy-content,
.about-section p,
.about-section ul {
    text-align: left;
}

.philosophy-content {
    padding: 0 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.philosophy-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 1.5rem 0;
}

.philosophy-content ul {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.philosophy-content li {
    font-size: 1.1rem;
    margin: 0.8rem 0;
    color: #444;
}

/* Testimonials */
.testimonial-carousel {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.testimonial-slide {
    display: none;
    padding: 1rem;
    animation: fadeEffect 1s;
}

.testimonial-slide.active {
    display: block;
}

.quote {
    font-size: 1.25rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.author {
    font-weight: 500;
    color: #666;
    font-size: 1.1rem;
}

@keyframes fadeEffect {
    from {opacity: 0.4}
    to {opacity: 1}
}

/* Form Styles */
.contact-form,
.privacy-content,
.terms-content,
.faq-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    margin-bottom: 2rem;
    border: 1px solid #ddd;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

textarea {
    min-height: 150px;
    resize: vertical;
}

input:focus, textarea:focus {
    border-color: #007bff;
    outline: none;
}

/* Legal Pages */
.last-updated {
    font-style: italic;
    color: #666;
    margin-bottom: 2rem;
}

.privacy-content h2,
.terms-content h2 {
    color: #2c3e50;
    margin: 2rem 0 1rem;
}

.privacy-content h2:first-child,
.terms-content h2:first-child {
    margin-top: 0;
}

.privacy-content p,
.terms-content p {
    margin-bottom: 1rem;
}

.privacy-content ul,
.terms-content ul {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.privacy-content li,
.terms-content li {
    margin-bottom: 0.5rem;
}

/* Audio Page */
.audio-hero {
    background-color: #f8f9fa;
    padding: 1.5rem 2rem;
    text-align: center;
    border-radius: 10px;
    margin-bottom: 2.5rem;
    border: 1px solid #ddd;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.audio-hero h2 {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: #333;
}

.audio-hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 2rem;
}

.podcast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.podcast-card {
    background-color: #fff;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.podcast-card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    transform: translateY(-10px);
}

.podcast-card:hover .podcast-title {
    color: #007bff;
}

.podcast-card:hover .podcast-logo {
    transform: scale(1.05);
}

.podcast-logo {
    width: 200px;
    height: 200px;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.podcast-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.podcast-description {
    margin-bottom: 1.5rem;
    color: #555;
}

.platform-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.platform-link {
    display: inline-block;
    text-decoration: none;
    transition: all 0.2s ease;
}

.platform-link img {
    height: 40px;
    width: auto;
    transition: transform 0.2s ease;
}

.platform-link:hover img {
    transform: scale(1.1);
}

.platform-link.disabled {
    opacity: 0.6;
    cursor: default;
    pointer-events: none;
}

.podcast-card.coming-soon {
    position: relative;
    overflow: hidden;
}

.coming-soon-badge {
    position: absolute;
    top: 40px;
    right: -60px;
    background-color: #007bff;
    color: white;
    font-weight: bold;
    text-align: center;
    line-height: 1.5;
    font-size: 1rem;
    transform: rotate(45deg);
    width: 250px;
    padding: 8px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
}

/* FAQ Page Styles */
.tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 4px solid #e9ecef;
    justify-content: space-between;
    flex-wrap: nowrap;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
    overflow-x: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-button {
    padding: 0.75rem 0.5rem;
    background: none;
    border: none;
    margin-bottom: -4px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: fit-content;
    flex: 1;
    text-align: center;
    flex-direction: column;
    position: relative;
    border-bottom: 4px solid transparent;
}

.tab-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    margin-bottom: 4px;
}

.tab-button:hover {
    color: #007bff;
}

.tab-button.active {
    color: #007bff;
    border-bottom: 4px solid #007bff;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 12px;
    background-color: #007bff;
    z-index: 1;
}

.tab-content {
    display: none;
    background-color: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    min-height: 200px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tab-content.active {
    display: block;
}

.feature-item {
    margin-bottom: 2rem;
}

.feature-item h3 {
    color: #34495e;
    margin-bottom: 0.5rem;
}

.tip-box {
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 4px 4px 0;
    color: #333;
}

code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
}

.search-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.search-input {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #007bff;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 1.2rem;
}

.back-to-top.visible {
    opacity: 1;
}

.loading-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.faq-item {
    margin-bottom: 1.5rem;
}

.faq-item h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.faq-item h4 {
    color: #34495e;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 500;
}

.faq-item ul {
    margin: 0.5rem 0 1rem 0;
    padding-left: 1.5rem;
}

.faq-item li {
    margin-bottom: 0.3rem;
    line-height: 1.5;
}

.faq-item .faq-item {
    margin-left: 1rem;
    margin-bottom: 1rem;
    padding-left: 1rem;
}

.faq-item .faq-item ul {
    padding-left: 1.2rem;
}

/* ===================================
   DARK MODE STYLES
   =================================== */

@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }

    .header, .footer {
        background-color: #2d2d2d;
        border-bottom-color: #333;
        border-top-color: #444;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    }

    .nav {
        background-color: #2d2d2d;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        border-top-color: #444;
        border-bottom-color: #444;
    }

    .nav a {
        color: #e0e0e0;
    }

    .nav a:hover {
        color: #66b3ff;
    }

    .footer a {
        color: #66b3ff;
    }

    .footer a:hover {
        color: #3399ff;
    }

    /* App Cards */
    .app-card {
        background-color: #2d2d2d;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        color: #e0e0e0;
    }

    .app-card:hover {
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
        transform: translateY(-8px) scale(1.03);
        background-color: #383838;
    }

    .app-title {
        color: #e0e0e0;
    }

    .app-card:hover .app-title {
        color: #66b3ff;
    }

    .app-store-link {
        color: #999;
    }

    .app-card .ribbon:not(.updated) {
        background-color: #ff3333;
    }
    
    .app-card .ribbon.updated {
        background-color: #66b3ff;
    }
    
    .app-card .ribbon.coming-soon {
        background-color: #32d74b;
    }

    /* Content Sections */
    .philosophy-section,
    .about-section,
    .testimonials,
    .audio-hero {
        background-color: #2d2d2d;
        border-color: #444;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }

    .philosophy-section h2,
    .about-section h2,
    .testimonials h2,
    .audio-hero h2,
    h2 {
        color: #66b3ff;
    }

    .philosophy-content p,
    .philosophy-content li {
        color: #e0e0e0;
    }

    .quote {
        color: #e0e0e0;
    }

    .author {
        color: #999;
    }

    /* Forms */
    .contact-form,
    .privacy-content,
    .terms-content,
    .tab-content {
        background-color: #2d2d2d;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        border-color: #444;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }

    input, textarea {
        background-color: #333;
        border-color: #444;
        color: #e0e0e0;
    }

    input:focus, textarea:focus {
        border-color: #66b3ff;
    }

    button {
        background-color: #66b3ff;
    }

    button:hover {
        background-color: #3399ff;
    }

    label {
        color: #e0e0e0;
    }

    .last-updated {
        color: #999;
    }

    .privacy-content h2,
    .terms-content h2 {
        color: #66b3ff;
    }

    .tip-box {
        background-color: #333;
        border-left-color: #66b3ff;
        color: #e0e0e0;
    }

    code {
        background-color: #333;
    }

    /* Audio Page */
    .podcast-card {
        background-color: #2d2d2d;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }

    .podcast-card:hover {
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
        transform: translateY(-10px);
    }

    .podcast-card:hover .podcast-title {
        color: #66b3ff;
    }

    .podcast-title {
        color: #66b3ff;
    }

    .podcast-description {
        color: #ccc;
    }

    .platform-link {
        background-color: #444;
        color: #e0e0e0;
    }

    .platform-link:hover {
        background-color: #66b3ff;
        color: #1a1a1a;
    }

    .coming-soon-badge {
        background-color: #66b3ff;
    }

    /* FAQ Page */
    .tabs {
        background-color: #1a1a1a;
        border-bottom-color: #333;
    }

    .tab-button {
        color: #999;
    }

    .tab-button:hover,
    .tab-button.active {
        color: #66b3ff;
    }

    .tab-button.active {
        border-bottom-color: #1a1a1a;
    }

    .tab-button.active::after {
        background-color: #66b3ff;
    }

    .feature-item h3 {
        color: #66b3ff;
    }

    .faq-item h3 {
        color: #e0e0e0;
    }
    
    .faq-item h4 {
        color: #cccccc;
    }

    .search-input {
        background-color: #2d2d2d;
        border-color: #333;
        color: #e0e0e0;
    }

    .back-to-top {
        background: #66b3ff;
    }

    .loading-spinner {
        border-color: #333;
        border-top-color: #66b3ff;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */

@media print {
    .nav, .footer, .tabs, .search-container, .back-to-top, .skip-link {
        display: none !important;
    }

    .tab-content {
        display: block !important;
        break-inside: avoid;
    }

    body {
        font-size: 12pt;
        color: black;
        background: white;
    }

    .feature-item, .faq-item {
        page-break-inside: avoid;
    }

    a {
        text-decoration: none;
        color: black;
    }

    .tip-box {
        border: 1px solid #000;
        padding: 1rem;
        margin: 1rem 0;
    }
}
