:root {
    --bg-color: #F9F8F4;
    /* Rice White */
    --card-bg: #FFFFFF;
    --text-primary: #2C2C2C;
    --text-secondary: #666666;
    --text-accent: #8A7E68;
    /* Muted Beige/Gold */
    --accent-color: #D4C5A5;
    --sidebar-bg: rgba(255, 255, 255, 0.95);

    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Montserrat', sans-serif;

    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.06);

    --transition-speed: 0.4s;
    --easing: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* Header */
.main-header {
    text-align: center;
    margin-bottom: 5rem;
    animation: fadeInDown 1s var(--easing);
    position: relative;
    /* Anchor absolute children (e.g. Admin button) */
}

.main-header h1 {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.header-top {
    position: absolute;
    top: 2rem;
    right: 2rem;
}

.header-top-left {
    position: absolute;
    top: 2rem;
    left: 2rem;
}

.admin-link-btn {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
    background: transparent;
    line-height: 1;
    padding: 0;
}

.admin-link-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
    background: rgba(0, 0, 0, 0.02);
}

.password-toggle-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.password-toggle-btn:hover {
    opacity: 1;
}

.password-toggle-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    /* Thin, elegant lines */
    stroke-linecap: round;
    stroke-linejoin: round;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 300;
}

/* Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Card */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    cursor: pointer;
    transition: box-shadow var(--transition-speed) var(--easing);
    /* Removed transform transition */
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    /* overflow: hidden;  REMOVED to allow tooltip to extend outside */
    border: 1px solid rgba(0, 0, 0, 0.02);
    height: 380px;
    /* Fixed height for consistency */
}

.card:hover {
    box-shadow: var(--shadow-hover);
    z-index: 10;
    /* Ensure tooltip appears above other cards */
}

.card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1.5rem;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.title-divider {
    font-family: var(--font-body);
    /* Use sans-serif for straight hyphen */
    display: inline-block;
    vertical-align: middle;
    position: relative;
    top: -2px;
    /* Lift slightly to center with Caps */
}

.card-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: auto;
    /* Push arrow to bottom */

    /* Truncate text */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    /* Limit to 4 lines */
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    /* For tooltip positioning context */
}

/* Custom Tooltip */
.card:hover::after {
    content: attr(data-full-text);
    position: absolute;
    /* Position above the description area */
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    padding: 1.2rem;
    background: rgba(44, 44, 44, 0.95);
    /* Darker, richer background */
    color: #fff;
    font-size: 0.9rem;
    border-radius: 12px;
    z-index: 100;
    pointer-events: none;
    white-space: normal;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    opacity: 0;
    animation: fadeIn 0.2s forwards;
    animation-delay: 0.3s;
    /* Slightly faster check */
    text-align: left;
    line-height: 1.5;
    font-weight: 400;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.card-arrow {
    margin-top: auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-accent);
    transition: all 0.3s ease;
}

.card:hover .card-arrow {
    background: var(--accent-color);
    color: white;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 66vw;
    height: 100vh;
    background: var(--bg-color);
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.6s var(--easing);
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    padding: 0;
    /* Full width for hero */
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 44, 44, 0.2);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.close-btn {
    position: absolute;
    top: 2rem;
    left: 2rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
}

.close-btn:hover {
    transform: rotate(90deg);
    background: rgba(255, 255, 255, 0.4);
    color: white;
}

/* Sidebar Hero */
.sidebar-hero {
    position: relative;
    width: 100%;
    height: 400px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.sidebar-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    /* Reduced blur */
    -webkit-backdrop-filter: blur(10px);
    z-index: 1;
}

.sidebar-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 250px;
    /* Taller gradient for smoother fade */
    background: linear-gradient(to bottom,
            rgba(249, 248, 244, 0) 0%,
            rgba(249, 248, 244, 0.1) 20%,
            rgba(249, 248, 244, 0.4) 40%,
            rgba(249, 248, 244, 0.8) 70%,
            rgba(249, 248, 244, 1) 100%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Bottom align */
    padding: 3rem 4rem;
    color: white;
    z-index: 1;
    text-align: left;
    /* Left align */
    align-items: flex-start;
    /* Left align items */
}

.hero-avatar {
    display: none;
    /* Hide large avatar in hero, move to meta bar? Or keep small? Plan says remove from hero basically */
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 300;
    max-width: 700px;
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* Sidebar Content Wrapper */
.sidebar-content-wrapper {
    padding: 0 4rem 5rem 4rem;
    background: var(--bg-color);
    position: relative;
    z-index: 2;
    margin-top: -20px;
}

/* Meta Bar */
.meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 3rem;
}

/* Owner Profile (Editorial Style) */
.owner-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.owner-photo-small {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.owner-info-text {
    display: flex;
    flex-direction: column;
}

.owner-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.owner-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Content Body */
.content-body {
    text-align: left;
}

.subscribe-btn {
    /* Reuse existing button styles, maybe adjust sizing */
    padding: 0.8rem 2rem;
    font-size: 0.85rem;
}

.content-section {
    margin-bottom: 3rem;
    animation: fadeInUp 0.5s ease backwards;
}

.content-section:nth-child(2) {
    animation-delay: 0.1s;
}

.content-section:nth-child(3) {
    animation-delay: 0.2s;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-accent);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.section-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
    max-width: 800px;
}

.action-area {
    margin-top: 4rem;
    text-align: center;
}

.subscribe-btn {
    display: inline-block;
    padding: 1rem 3rem;
    background-color: var(--text-primary);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.subscribe-btn:hover {
    background-color: var(--text-accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100vw;
        padding: 2rem;
    }

    .channel-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .channel-info h2 {
        font-size: 2.5rem;
    }

    .owner-badge {
        flex-direction: column;
        background: none;
        box-shadow: none;
    }

    .main-header h1 {
        font-size: 2.5rem;
    }
}