/* The Zone - Stylesheet */

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

:root {
    --primary: #00FF66;
    --dark: #0A0A0A;
    --gray-dark: #1A1A1A;
    --gray-mid: #2A2A2A;
    --gray-light: #4A4A4A;
    --text: #FFFFFF;
    --text-muted: #9A9A9A;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--dark);
    color: var(--text);
    line-height: 1.6;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 250px;
    background: var(--gray-dark);
    border-right: 1px solid var(--gray-mid);
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
}

.sidebar .logo h1 {
    padding: 0 2rem 2rem;
    font-size: 1.5rem;
    border-bottom: 1px solid var(--gray-mid);
}

.nav-menu {
    list-style: none;
    flex: 1;
    padding: 2rem 0;
}

.nav-menu li a {
    display: block;
    padding: 1rem 2rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    color: var(--primary);
    background: var(--gray-mid);
}

.user-footer {
    padding: 1rem 2rem;
    border-top: 1px solid var(--gray-mid);
}

.premium-btn {
    display: block;
    padding: 0.75rem;
    background: linear-gradient(135deg, #F59E0B, #EAB308);
    color: var(--dark);
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    margin-bottom: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.username {
    font-weight: 600;
}

.xp {
    font-size: 0.875rem;
    color: var(--primary);
}

.settings-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
}

/* Main Content */
.content {
    margin-left: 250px;
    padding: 2rem;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.hero {
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stats-grid {
    margin: 2rem 0;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    margin-top: 0.5rem;
}

/* Auth Pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--dark), var(--gray-dark));
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.auth-box {
    background: var(--gray-dark);
    border: 1px solid var(--gray-mid);
    border-radius: 12px;
    padding: 2rem;
}

.auth-box h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.auth-box h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.form-group.checkbox {
    flex-direction: row;
    gap: 0.5rem;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    padding: 0.75rem;
    background: var(--gray-mid);
    border: 1px solid var(--gray-light);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group small {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: var(--dark);
}

.btn-primary:hover {
    background: #00CC52;
}

.btn-primary:disabled {
    background: var(--gray-light);
    cursor: not-allowed;
}

.form-footer {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-muted);
}

.form-footer a {
    color: var(--primary);
    text-decoration: none;
}

.message {
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    display: none;
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #FCA5A5;
    display: block;
}

.message.success {
    background: rgba(0, 255, 102, 0.1);
    border: 1px solid rgba(0, 255, 102, 0.5);
    color: var(--primary);
    display: block;
}

/* Onboarding */
.onboarding-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.onboarding-box {
    text-align: center;
}

.onboarding-box h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

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

.sport-card {
    background: var(--gray-dark);
    border: 2px solid var(--gray-mid);
    border-radius: 12px;
    padding: 2rem 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.sport-card:hover {
    border-color: var(--gray-light);
    transform: translateY(-2px);
}

.sport-card.selected {
    border-color: var(--primary);
    background: rgba(0, 255, 102, 0.1);
}

.sport-card.selected::after {
    content: '✓';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: var(--primary);
    font-size: 1.5rem;
}

.sport-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.sport-name {
    font-weight: 600;
}

/* Cards */
.card {
    background: var(--gray-dark);
    border: 1px solid var(--gray-mid);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.card:hover {
    border-color: var(--primary);
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 1.5rem;
}

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

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

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Story editor preview */
#story-editor-preview {
    height: 550px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .content {
        margin-left: 0;
        padding: 1rem;
    }

    .hero h1 {
        font-size: 1.75rem;
        line-height: 1.2;
        padding: 0 0.5rem;
    }

    .hero {
        padding: 1rem 0;
        margin-bottom: 1rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .card {
        padding: 1rem;
    }

    .card h3 {
        font-size: 1rem;
    }

    .grid {
        gap: 1rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 0.5rem;
    }

    .stats-grid {
        margin: 1rem 0;
    }

    section.mt-4 {
        margin-top: 1.5rem !important;
    }

    section h2 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
    }

    /* Auth pages mobile */
    .auth-container {
        padding: 1rem;
    }

    .auth-box {
        padding: 1.5rem;
    }

    .auth-box h1 {
        font-size: 1.5rem;
    }

    /* Onboarding mobile */
    .onboarding-container {
        padding: 1rem;
    }

    .onboarding-box h1 {
        font-size: 1.75rem;
    }

    .sports-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .sport-card {
        padding: 1.5rem 0.75rem;
    }

    .sport-icon {
        font-size: 2rem;
    }

    /* Modal mobile */
    .modal-content {
        margin: 0.5rem;
        max-width: calc(100% - 1rem) !important;
        max-height: 95vh !important;
    }

    .modal-header {
        padding: 1rem !important;
    }

    .modal-header h2 {
        font-size: 1.1rem !important;
    }

    .modal-body {
        padding: 0.75rem !important;
        padding-bottom: 4rem !important;
        overflow-y: auto;
    }

    /* Fix Create Story modal on mobile */
    .modal-body > form > div[style*="grid-template-columns: 380px"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }

    /* Story preview on mobile */
    #story-editor-preview {
        width: 100% !important;
        height: 200px !important;
        margin: 0 auto;
    }

    /* Story editor controls on mobile */
    .modal-body > form > div > div:last-child {
        max-height: none !important;
        padding-right: 0 !important;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.5rem !important;
        margin-bottom: 2rem !important;
    }

    .form-actions button {
        width: 100%;
        padding: 0.875rem 1rem !important;
        font-size: 1rem !important;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--gray-dark);
    border-top: 1px solid var(--gray-mid);
    padding: 0.5rem 0;
    z-index: 1000;
}

.mobile-nav-menu {
    display: flex;
    justify-content: space-around;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-menu li {
    flex: 1;
    text-align: center;
}

.mobile-nav-menu a {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.65rem;
    padding: 0.5rem;
    transition: all 0.3s;
}

.mobile-nav-menu a span {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.mobile-nav-menu a.active,
.mobile-nav-menu a:active {
    color: var(--primary);
}

@media (max-width: 768px) {
    .mobile-nav {
        display: block;
    }

    .content {
        padding-bottom: 5rem;
    }
}
