/*
 * GanjaTube Design System
 * Mobile-First · Dark Theme · Cannabis Culture
 *
 * Breakpoints:
 *   Default    = Mobile (< 640px)
 *   sm         = 640px+  (große Phones / kleine Tablets)
 *   md         = 768px+  (Tablets)
 *   lg         = 1024px+ (Desktop)
 *   xl         = 1280px+ (große Screens)
 */

/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --gt-green: #CB4EBE;
    --gt-green-light: #E06ED6;
    --gt-green-dark: #8A2BE2;
    --gt-green-glow: rgba(203, 78, 190, 0.2);
    --gt-black: #0A0A0A;
    --gt-dark: #111111;
    --gt-card: #1A1A1A;
    --gt-card-hover: #222222;
    --gt-text: #E8E6E0;
    --gt-text-muted: #A8A6A0;
    --gt-accent: #F4C430;
    --gt-border: rgba(255,255,255,0.06);
    --gt-border-hover: rgba(255,255,255,0.12);
    --gt-danger: #E24B4A;
    --gt-danger-bg: rgba(226,75,74,0.1);
    --gt-success-bg: rgba(203,78,190,0.1);

    --header-height: 56px;
    --bottom-nav-height: 56px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gt-black);
    color: var(--gt-text);
    line-height: 1.5;
    overflow-x: hidden;
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
}

@media (min-width: 1024px) {
    body { padding-bottom: 0; }
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ===== HEADER (MOBILE) ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--gt-dark);
    border-bottom: 1px solid var(--gt-border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    z-index: 100;
    gap: 8px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}
.header-logo .ganja { color: var(--gt-green-light); }
.header-logo .tube { color: var(--gt-text); }

.logo-mark {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: linear-gradient(135deg, var(--gt-green), var(--gt-green-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.logo-mark svg { width: 16px; height: 16px; fill: white; }

.header-search {
    flex: 1;
    display: none; /* Hidden on mobile */
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.header-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--gt-text-muted);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.header-btn:hover, .header-btn:active { background: rgba(255,255,255,0.06); color: var(--gt-text); }

.avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gt-green-dark);
    color: white;
    font-weight: 600;
    font-size: 0.7rem;
    border: 2px solid var(--gt-green);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Search bar visible on tablets+ */
@media (min-width: 640px) {
    .header { padding: 0 16px; }
    .header-search {
        display: flex;
        flex: 1;
        max-width: 480px;
        margin: 0 auto;
    }
    .search-input {
        flex: 1;
        height: 36px;
        background: var(--gt-black);
        border: 1px solid var(--gt-border);
        border-right: none;
        border-radius: 18px 0 0 18px;
        padding: 0 14px;
        color: var(--gt-text);
        font-family: inherit;
        font-size: 0.85rem;
        outline: none;
    }
    .search-input:focus { border-color: var(--gt-green); }
    .search-input::placeholder { color: var(--gt-text-muted); }
    .search-btn {
        width: 48px;
        height: 36px;
        background: var(--gt-card);
        border: 1px solid var(--gt-border);
        border-radius: 0 18px 18px 0;
        color: var(--gt-text-muted);
        font-size: 0.9rem;
    }
}

@media (min-width: 1024px) {
    .header { padding: 0 20px; }
    .header-search { max-width: 560px; }
}

/* ===== MOBILE SEARCH (overlay) ===== */
.mobile-search {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--gt-dark);
    z-index: 110;
    padding: 8px 12px;
    align-items: center;
    gap: 8px;
}
.mobile-search.open { display: flex; }
.mobile-search input {
    flex: 1;
    height: 40px;
    background: var(--gt-black);
    border: 1px solid var(--gt-border);
    border-radius: 20px;
    padding: 0 16px;
    color: var(--gt-text);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}
.mobile-search input:focus { border-color: var(--gt-green); }
.mobile-search .close-search {
    background: none;
    border: none;
    color: var(--gt-text-muted);
    font-size: 1.5rem;
    padding: 4px;
}

/* ===== BOTTOM NAVIGATION (MOBILE) ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--gt-dark);
    border-top: 1px solid var(--gt-border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 2px 12px;
    color: var(--gt-text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item .nav-icon { font-size: 1.25rem; line-height: 1; display: flex; }
.bottom-nav-item.active { color: var(--gt-green-light); }
.bottom-nav-item:active { color: var(--gt-text); }

.bottom-nav-upload {
    width: 40px;
    height: 32px;
    border-radius: 8px;
    background: var(--gt-green);
    border: none;
    color: white;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide bottom nav on desktop */
@media (min-width: 1024px) {
    .bottom-nav { display: none; }
}

/* ===== SIDEBAR (DESKTOP ONLY) ===== */
.sidebar {
    display: none;
}

@media (min-width: 1024px) {
    .sidebar {
        display: block;
        position: fixed;
        top: var(--header-height);
        left: 0;
        bottom: 0;
        width: 220px;
        background: var(--gt-dark);
        border-right: 1px solid var(--gt-border);
        overflow-y: auto;
        padding: 8px 0;
        z-index: 50;
    }
    .sidebar-section { padding: 6px 10px; }
    .sidebar-section + .sidebar-section { border-top: 1px solid var(--gt-border); margin-top: 6px; padding-top: 12px; }
    .sidebar-label { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gt-text-muted); padding: 0 10px; margin-bottom: 6px; }
    .sidebar-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--gt-text); font-size: 0.84rem; transition: background 0.15s; }
    .sidebar-link:hover { background: rgba(255,255,255,0.04); }
    .sidebar-link.active { background: var(--gt-green-glow); color: var(--gt-green-light); font-weight: 500; }
    .sidebar-link .icon { width: 18px; text-align: center; font-size: 0.95rem; }
}

/* ===== MAIN CONTENT ===== */
.main {
    margin-top: var(--header-height);
    padding: 12px;
    min-height: calc(100vh - var(--header-height));
}

@media (min-width: 640px) {
    .main { padding: 16px; }
}

@media (min-width: 1024px) {
    .main { margin-left: 220px; padding: 20px 24px; }
}

/* ===== CATEGORY CHIPS ===== */
.category-bar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.category-bar::-webkit-scrollbar { display: none; }

.chip {
    white-space: nowrap;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    background: var(--gt-card);
    border: 1px solid var(--gt-border);
    color: var(--gt-text);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.chip:active { transform: scale(0.96); }
.chip.active { background: var(--gt-green); border-color: var(--gt-green); color: white; }

/* ===== VIDEO GRID ===== */
.section-heading {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.video-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 28px;
}

@media (min-width: 480px) {
    .video-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}
@media (min-width: 768px) {
    .video-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}
@media (min-width: 1280px) {
    .video-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
}

/* ===== VIDEO CARD ===== */
.video-card {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.thumbnail-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--gt-card);
}

.thumbnail {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.duration-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.82);
    color: white;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 2px 5px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

.video-info {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.channel-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gt-card);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--gt-green-light);
    border: 1px solid var(--gt-border);
}

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

.video-title {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 3px;
}

.video-channel {
    font-size: 0.76rem;
    color: var(--gt-text-muted);
}

.video-stats {
    font-size: 0.73rem;
    color: var(--gt-text-muted);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--gt-green), var(--gt-green-dark));
    color: white;
}
.btn-primary:hover { box-shadow: 0 4px 16px var(--gt-green-glow); }

.btn-secondary {
    background: var(--gt-card);
    color: var(--gt-text);
    border: 1px solid var(--gt-border);
}
.btn-secondary:hover { background: var(--gt-card-hover); }

.btn-outline {
    background: transparent;
    color: var(--gt-text-muted);
    border: 1px solid var(--gt-border);
}

.btn-danger {
    background: var(--gt-danger-bg);
    color: var(--gt-danger);
    border: 1px solid rgba(226,75,74,0.3);
}

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-full { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 50%; }

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gt-text-muted);
    margin-bottom: 6px;
}
.form-input, .form-textarea, .form-select {
    width: 100%;
    background: var(--gt-black);
    border: 1px solid var(--gt-border);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    color: var(--gt-text);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}
.form-input { height: 44px; }
.form-textarea { padding: 12px 14px; min-height: 100px; resize: vertical; }
.form-select { height: 44px; }
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--gt-green); }
.form-input::placeholder, .form-textarea::placeholder { color: rgba(255,255,255,0.2); }
.form-hint { font-size: 0.72rem; color: var(--gt-text-muted); margin-top: 4px; }

/* ===== ALERTS ===== */
.alert { border-radius: var(--radius-sm); padding: 10px 14px; font-size: 0.82rem; margin-bottom: 16px; }
.alert-error { background: var(--gt-danger-bg); border: 1px solid rgba(226,75,74,0.3); color: var(--gt-danger); }
.alert-success { background: var(--gt-success-bg); border: 1px solid rgba(59,175,78,0.3); color: var(--gt-green-light); }

/* ===== UTILITIES ===== */
.text-muted { color: var(--gt-text-muted); }
.text-green { color: var(--gt-green-light); }
.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.72rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.gap-1 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.hidden-mobile { display: none; }
@media (min-width: 640px) { .hidden-mobile { display: initial; } }
.hidden-desktop { display: initial; }
@media (min-width: 1024px) { .hidden-desktop { display: none; } }
