/*
    AESTHETIC & TONE:
    - Minecraft-themed, colorful, and creative.
    - Use blocky/pixel accents, soft-but-not-too-soft color palette.
    - Bright but not neon; friendly and playful.
    - No hacker/terminal aesthetic.
    - Rounded cards, subtle shadows, and pixel-art icons.
    - Headings may use a pixel-style web font.
*/

:root {
    /* Refined Minecraft Palette */
    --color-primary: #5FAD56;       /* Vibrant Grass Green */
    --color-secondary: #E4F0F9;     /* Light Sky Blue */
    --color-tertiary: #5D4A46;      /* Rich Earth Brown */
    --color-light-bg: #F5EFE6;      /* Warm, Sandy Background */
    --color-dark-text: #3B342B;     /* Dark, Readable Text */
    --color-white: #FFFFFF;         /* Pure White */
    
    --color-button-shadow: #3E7235; /* Darker green for button shadow */
    --color-tertiary-shadow: #3B2E2D; /* Darker brown for button shadow */
    
    --font-pixel: 'Press Start 2P', cursive;
    --font-rounded: 'Quicksand', sans-serif;
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-rounded);
    color: var(--color-dark-text);
    background-color: var(--color-light-bg);
    line-height: 1.6;
    
    /* Subtle background texture */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4" viewBox="0 0 4 4"><rect width="2" height="2" fill="%23e8e2d7"/><rect x="2" y="2" width="2" height="2" fill="%23e8e2d7"/><rect x="2" width="2" height="2" fill="%23f2f0e6"/><rect y="2" width="2" height="2" fill="%23f2f0e6"/></svg>');
    background-repeat: repeat;
    background-size: 8px 8px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Typography */
.site-title, .hero-title, .section-title, .modal-title {
    font-family: var(--font-pixel);
    color: var(--color-dark-text);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.15);
    letter-spacing: -2px;
}

.site-title {
    font-size: 1.5rem;
}

.hero-title {
    font-size: 2.5rem;
    color: var(--color-primary);
}

.section-title {
    font-size: 2rem;
    color: var(--color-tertiary);
    margin-bottom: 2rem;
}

.hero-subtitle {
    font-family: var(--font-rounded);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-dark-text);
}

.hero-description, .section-description, .submission-note, .modal-description {
    font-family: var(--font-rounded);
    font-size: 1.1rem;
}

/* Layout */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.section {
    padding: 3rem 0;
}

/* Header & Nav */
.site-header {
    background-color: var(--color-secondary);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 50;
}

.logo-and-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pixel-icon {
    font-size: 2rem;
    color: var(--color-dark-text);
}

.site-nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    text-decoration: none;
    color: var(--color-dark-text);
    font-weight: bold;
    transition: color 0.3s;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 0;
    height: 3px;
    background-color: var(--color-primary);
    transition: width 0.3s ease-in-out;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:focus::after {
    width: 100%;
}

/* Buttons */
.button {
    font-family: var(--font-pixel);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s, transform 0.1s, box-shadow 0.3s;
    box-shadow: 0 4px 0px var(--color-button-shadow);
    margin-top: 1rem;
    user-select: none;
}

.button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0px var(--color-button-shadow);
}

.button--subscribe, .button--large {
    background-color: var(--color-primary);
    color: var(--color-dark-text);
    animation: pulse 2s infinite ease-in-out;
}

.button--subscribe:hover, .button--large:hover {
    background-color: #79C070;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.button--submit {
    background-color: var(--color-tertiary);
    color: var(--color-white);
    box-shadow: 0 4px 0px var(--color-tertiary-shadow);
}

.button--submit:hover {
    background-color: var(--color-tertiary-shadow);
}

/* Hero Section */
.hero-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-top: 2rem;
}

@media (min-width: 768px) {
    .hero-section {
        grid-template-columns: 2fr 1fr;
        align-items: center;
    }
}

.hero-left-col {
    text-align: center;
}

.hero-right-col {
    text-align: center;
    padding: 1.5rem;
    background-color: var(--color-white);
    border-radius: 12px;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Video Player & Grid */
.video-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.08);
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.video-card {
    background-color: var(--color-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.1),
        0 1px 2px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: var(--color-dark-text);
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

.video-thumbnail {
    width: 100%;
    height: auto;
    display: block;
}

.video-content {
    padding: 1rem;
}

.video-title {
    font-family: var(--font-rounded);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.video-meta {
    font-size: 0.9rem;
    color: #666;
}

/* Toggle Switch for Local Uploads */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.toggle-label {
    font-family: var(--font-rounded);
    font-weight: bold;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-tertiary);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: var(--color-white);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--color-primary);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Downloads Section */
.downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.download-card {
    background-color: var(--color-white);
    border-radius: 12px;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.1),
        0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.download-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

.download-title {
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.download-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.copy-button {
    background-color: var(--color-secondary);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-rounded);
    font-weight: bold;
    transition: background-color 0.3s;
}

.copy-button:hover {
    background-color: #C0E0F0;
}

/* Clips Submission Form */
.clips-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background-color: var(--color-white);
    border-radius: 12px;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.1),
        0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.clips-form input {
    font-family: var(--font-rounded);
    padding: 0.75rem;
    border: 2px solid var(--color-secondary);
    border-radius: 8px;
    background-color: var(--color-light-bg);
}

.clips-form input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(95, 173, 86, 0.3);
}

.submission-note {
    font-size: 0.9rem;
    color: #666;
    margin-top: 1rem;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--color-secondary);
    color: var(--color-dark-text);
    margin-top: 2rem;
    box-shadow: inset 0 4px 6px rgba(0,0,0,0.1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--color-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    position: relative;
    text-align: center;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #888;
}

.email-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.email-form input {
    padding: 0.75rem;
    border: 2px solid var(--color-secondary);
    border-radius: 8px;
    font-family: var(--font-rounded);
    width: 100%;
}

/* New: Loading State */
.loading-state {
    text-align: center;
    padding: 3rem 0;
    font-family: var(--font-pixel);
    color: var(--color-dark-text);
    font-size: 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}