/* Caissa Club - Responsive Styles */
/* Mobile-first approach: 320px base, scaling up to 2560px */

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    overflow-x: hidden;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1a1a2e;
    background-color: #fafafa;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* === Navigation Header === */
header {
    background-color: #1a1a2e;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

header nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

header nav a {
    color: #e0e0e0;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: color 0.2s, background-color 0.2s;
}

header nav a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

/* === Main Content === */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

main > h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #1a1a2e;
}

main > p {
    color: #4a4a6a;
    margin-bottom: 2rem;
}

/* === Landing Page: Hero Section === */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d5e 100%);
    border-radius: 12px;
    color: #ffffff;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.hero .tagline {
    font-size: 1.15rem;
    color: #c8c8e0;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Download CTA - visually distinguishable through size, color, and shape */
.cta-download {
    display: inline-block;
    background-color: #22c55e;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 0.9rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}

.cta-download:hover {
    background-color: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.45);
    text-decoration: none;
}

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

/* Disabled state for download button */
.cta-download-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* === Downloads Grid === */
.downloads-grid {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 0 auto;
}

.download-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    width: 20%;
    min-width: 120px;
}

.download-card:hover {
    text-decoration: none;
}

.download-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: block;
}

.download-icon-box {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.download-os {
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
}

.download-status {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Active card (Linux) */
.download-card--active {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    color: #ffffff;
    cursor: pointer;
}

.download-card--active .download-icon {
    color: #22c55e;
}

.download-card--active .download-status {
    color: #22c55e;
}

.download-card--active:hover {
    background: rgba(34, 197, 94, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
}

/* Disabled card (macOS, Windows) */
.download-card--disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
    color: #9ca3af;
}

.download-card--disabled .download-icon {
    color: #9ca3af;
}

.download-card--disabled .download-os {
    color: #9ca3af;
}

.download-card--disabled .download-status {
    color: #6b7280;
}

/* === Stores Grid === */
.stores-grid {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.store-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    transition: transform 0.2s, opacity 0.2s;
}

.store-badge:hover {
    text-decoration: none;
}

.store-badge-img {
    height: 40px;
    width: auto;
    border-radius: 5px;
}

.store-badge-status {
    font-size: 0.7rem;
    font-weight: 500;
    color: #9ca3af;
}

.store-badge--disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
}

.store-badge--active {
    opacity: 1;
    cursor: pointer;
}

.store-badge--active:hover {
    transform: translateY(-2px);
}

.store-badge--active .store-badge-status {
    display: none;
}

/* === Navigation Logo === */
.nav-logo {
    height: 36px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

/* === Landing Page: Features Section === */
.features {
    margin-bottom: 3rem;
}

.features h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: #1a1a2e;
}

.feature-list {
    list-style: none;
    display: grid;
    gap: 1.25rem;
}

.feature-list li {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem;
    transition: box-shadow 0.2s;
}

.feature-list li:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.feature-list h3 {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    color: #1a1a2e;
}

.feature-list p {
    font-size: 0.95rem;
    color: #4a4a6a;
}

/* === Landing Page: Screenshot Section === */
.screenshot {
    margin-bottom: 3rem;
}

.screenshot h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: #1a1a2e;
}

.screenshot img {
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    width: 100%;
}

/* === Training Page: Video Categories === */
.video-category {
    margin-bottom: 3rem;
}

.video-category h2 {
    font-size: 1.5rem;
    color: #1a1a2e;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

/* === Training Page: Video Entries === */
.video-entry {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.video-info h3 {
    font-size: 1.1rem;
    color: #1a1a2e;
    margin-bottom: 0.4rem;
}

.video-description {
    font-size: 0.95rem;
    color: #4a4a6a;
    margin-bottom: 0.4rem;
}

.video-duration {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

.video-player {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 6px;
}

.video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 6px;
}

.video-unavailable {
    background-color: #fef2f2;
    color: #991b1b;
    padding: 2rem;
    text-align: center;
    border-radius: 6px;
    border: 1px solid #fecaca;
    font-size: 0.95rem;
}

/* === Feedback Page: Form === */
#feedback-form {
    max-width: 600px;
    margin-bottom: 2rem;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: #1a1a2e;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: inherit;
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #ffffff;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

/* Radio button group for submission type */
.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.4rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 400;
    cursor: pointer;
    font-size: 0.95rem;
    color: #1a1a2e;
}

.radio-group input[type="radio"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

/* Inline validation error messages - red and adjacent to fields */
.error-message {
    display: block;
    color: #dc2626;
    font-size: 0.85rem;
    margin-top: 0.3rem;
    min-height: 1.2rem;
}

.error-message:empty {
    display: none;
}

.error-message[hidden] {
    display: none;
}

/* General error (non-field) */
#general-error {
    background-color: #fef2f2;
    color: #dc2626;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #fecaca;
    font-size: 0.95rem;
    margin-top: 1rem;
}

#general-error[hidden] {
    display: none;
}

/* Confirmation message - green */
.confirmation {
    background-color: #f0fdf4;
    color: #166534;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #bbf7d0;
    font-size: 0.95rem;
    margin-top: 1rem;
}

.confirmation[hidden] {
    display: none;
}

/* Submit button */
#submit-btn {
    display: inline-block;
    background-color: #2563eb;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: inherit;
}

#submit-btn:hover {
    background-color: #1d4ed8;
}

#submit-btn:disabled {
    background-color: #93c5fd;
    cursor: not-allowed;
}

/* === Error Page === */
body:has(main > h1:only-of-type) main {
    text-align: center;
    padding-top: 4rem;
}

/* Fallback for error page styling (since :has may not work everywhere) */
main a {
    display: inline-block;
    margin-top: 1rem;
}

/* === Footer === */
footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    text-align: center;
    border-top: 1px solid #e5e7eb;
}

footer p {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

footer p:last-child {
    margin-bottom: 0;
}

footer a {
    color: #6b7280;
    text-decoration: underline;
    transition: color 0.2s;
}

footer a:hover {
    color: #2563eb;
}

/* === Responsive Breakpoints === */

/* Tablet: 768px and up */
@media (min-width: 768px) {
    header nav {
        gap: 2rem;
    }

    header nav a {
        font-size: 1rem;
    }

    main {
        padding: 3rem 2rem;
    }

    main > h1 {
        font-size: 2.5rem;
    }

    .hero {
        padding: 4rem 2rem;
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    .hero .tagline {
        font-size: 1.25rem;
    }

    .feature-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .video-entry {
        flex-direction: row;
        align-items: flex-start;
    }

    .video-info {
        flex: 1;
        min-width: 0;
    }

    .video-player {
        flex: 0 0 320px;
        padding-bottom: 0;
        height: 180px;
    }
}

/* Desktop: 1024px and up */
@media (min-width: 1024px) {
    main {
        padding: 3rem 2rem;
    }

    .hero {
        padding: 5rem 3rem;
    }

    .hero h1 {
        font-size: 4rem;
    }

    .feature-list {
        grid-template-columns: repeat(3, 1fr);
    }

    .video-player {
        flex: 0 0 400px;
        height: 225px;
    }
}

/* Large desktop: 1440px and up */
@media (min-width: 1440px) {
    html {
        font-size: 17px;
    }

    .hero {
        padding: 6rem 4rem;
        border-radius: 16px;
    }

    .hero h1 {
        font-size: 4.5rem;
    }
}

/* Ultra-wide: 2560px */
@media (min-width: 2560px) {
    html {
        font-size: 18px;
    }

    main {
        max-width: 1400px;
    }
}
