/* YouTube Light Mode Design System */
:root {
    /* Color Palette - YouTube Light */
    --bg-body: #f9f9f9;
    --bg-surface: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-header: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f2f2f2;
    --bg-active: #e5e5e5;
    --bg-search: #f8f8f8;
    --bg-muted: #f1f1f1;
    --bg-avatar: #e6e6e6;
    --border-search: #cccccc;

    --primary: #ff0000;
    /* YouTube Red */
    --primary-hover: #cc0000;
    --text-main: #0f0f0f;
    --text-secondary: #606060;
    --border: #e5e5e5;
    --icon-color: #0f0f0f;

    /* Typography */
    --font-family: "Roboto", "Arial", sans-serif;
    --font-size-base: 14px;
    /* YouTube tends to be slightly smaller/dense */
    --font-size-lg: 16px;
    --font-size-xl: 20px;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 700;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Components */
    --radius-sm: 4px;
    --radius-md: 12px;
    /* For rounded thumbnails/cards */
    --radius-full: 9999px;
    /* For pills, avatars */
    --radius-search: 40px;
    --shadow-sm: 0 1px 2px rgba(15, 15, 15, 0.08);

    --header-height: 56px;
    --sidebar-width: 240px;
    --sidebar-width-collapsed: 72px;

    --transition: background-color 0.2s cubic-bezier(0.2, 0, 0, 1), transform 0.2s, box-shadow 0.2s;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: normal;
    font-size: var(--font-size-base);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--text-main);
    text-decoration: none;
}

ul {
    list-style: none;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-weight-bold);
    color: var(--text-main);
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: var(--font-size-xl);
}

h2 {
    font-size: 18px;
}

h3 {
    font-size: 16px;
}

p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.4;
}

/* Layout Utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-1 {
    gap: var(--spacing-xs);
}

.gap-2 {
    gap: var(--spacing-sm);
}

.gap-3 {
    gap: var(--spacing-md);
}

.gap-4 {
    gap: var(--spacing-lg);
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.hidden {
    display: none;
}

/* Main Layout Shell */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content-wrapper {
    display: flex;
    flex: 1;
    margin-top: var(--header-height);
}

.sidebar-container {
    width: var(--sidebar-width);
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    background-color: var(--bg-sidebar);
    overflow-y: auto;
    padding-right: var(--spacing-sm);
    border-right: 1px solid var(--border);
    /* Scrollbar styling */
}

.sidebar-container::-webkit-scrollbar {
    width: 8px;
}

.sidebar-container::-webkit-scrollbar-thumb {
    background-color: transparent;
    border-radius: 4px;
}

.sidebar-container:hover::-webkit-scrollbar-thumb {
    background-color: #717171;
}

.content-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--spacing-lg);
    background-color: var(--bg-body);
}

/* Header */
header.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--bg-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-md);
    z-index: 100;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.menu-btn {
    padding: var(--spacing-sm);
    border-radius: 50%;
}

.menu-btn:hover {
    background-color: var(--bg-hover);
}

.logo {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: -0.5px;
}

.logo-icon {
    color: var(--primary);
    width: 28px;
    height: 28px;
}

.logo-icon img {
    display: block;
    height: 28px;
    object-fit: contain;
}

.header-center {
    flex: 1;
    max-width: 720px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-bar {
    display: flex;
    width: 100%;
    max-width: 600px;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    background-color: var(--bg-search);
    border: 1px solid var(--border-search);
    border-right: none;
    border-radius: var(--radius-search) 0 0 var(--radius-search);
    padding: 10px 16px;
    color: var(--text-main);
    font-size: 16px;
    outline: none;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.04);
}

.search-input:focus {
    border-color: #1c62b9;
    margin-left: 0;
    /* Adjust if needed for focus ring */
}

.search-btn {
    background-color: var(--bg-search);
    border: 1px solid var(--border-search);
    border-radius: 0 var(--radius-search) var(--radius-search) 0;
    padding: 6px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background-color: var(--bg-hover);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background-color: var(--bg-hover);
}

/* Sidebar Navigation */
.nav-section {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.nav-section:last-child {
    border-bottom: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 12px;
    height: 40px;
    border-radius: 10px;
    color: var(--text-main);
    font-size: 14px;
}

.nav-item:hover {
    background-color: var(--bg-hover);
}

.nav-item.active {
    background-color: var(--bg-active);
    font-weight: var(--font-weight-medium);
}

.nav-item svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    height: 36px;
    border-radius: 18px;
    /* Pill shape */
    font-weight: var(--font-weight-medium);
    font-size: 14px;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--text-main);
    color: var(--bg-body);
}

.btn-primary:hover {
    background-color: #d9d9d9;
}

.btn-danger {
    background-color: var(--bg-hover);
    color: var(--text-main);
}

.btn-danger:hover {
    background-color: #3f3f3f;
}

/* Auth / Login Specifics */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--bg-body);
}

.auth-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    /* Google logic typically square-ish rounded */
    padding: 48px 40px 36px;
    width: 100%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 12px 40px rgba(15, 15, 15, 0.08);
}

.auth-card h2 {
    font-weight: 400;
    margin-bottom: var(--spacing-sm);
}

.auth-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 32px;
    width: 100%;
}

.form-group {
    width: 100%;
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    color: var(--text-main);
}

.form-input {
    width: 100%;
    padding: 13px 15px;
    background-color: transparent;
    border: 1px solid #cfcfcf;
    border-radius: 4px;
    color: var(--text-main);
    font-size: 16px;
}

.form-input:focus {
    border-color: #1c62b9;
    /* Google blue-ish */
    outline: 2px solid transparent;
    box-shadow: 0 0 0 2px rgba(28, 98, 185, 0.12);
}

/* Flash Messages */
.flash-messages {
    margin-bottom: var(--spacing-md);
}

.flash-message {
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: #ffffff;
    color: var(--text-main);
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar-container {
        display: none;
        /* Hide for now, or transform to modal drawer */
    }

    .content-area {
        margin-left: 0;
    }

    .search-bar {
        display: none;
        /* Often hidden behind a search icon on mobile */
    }
}
