/* --- Yume Panel CSS --- */

:root {
    /* Dark Mode - Midnight Sakura 🌸 */
    --bg-color: #1a1625;
    --sidebar-bg: #282438;
    --content-bg: #121016;
    --text-main: #f0ebf5;
    --text-muted: #aba6bf;
    --accent: #ff85a1; /* Sakura Pink */
    --accent-hover: #ff5c8d;
    --accent-secondary: #b580ff;
    --border: rgba(255, 133, 161, 0.2);
    --hover-item: rgba(255, 133, 161, 0.1);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

body.light-mode {
    /* Light Mode - Strawberry Milk 🥛 */
    --bg-color: #fff5f8;
    --sidebar-bg: #ffffff;
    --content-bg: #fdf0f5;
    --text-main: #4a4055;
    --text-muted: #8e829a;
    --accent: #ff5c8d;
    --accent-hover: #ff3370;
    --border: rgba(255, 92, 141, 0.15);
    --hover-item: rgba(255, 92, 141, 0.08);
    --shadow: 0 8px 25px rgba(255, 92, 141, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg-color);
    color: var(--text-main);
    height: 100vh;
    display: flex; /* To musi zostać! */
    overflow: hidden;
    margin: 0;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 25px;
    z-index: 100;
}

.sidebar-header h1 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.6rem;
    color: var(--accent);
    text-align: center;
    margin-bottom: 25px;
    letter-spacing: -0.5px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: var(--hover-item);
    border-radius: 20px;
    margin-bottom: 30px;
    border: 1px solid var(--border);
}

.avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, var(--accent), var(--accent-secondary));
    border-radius: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 12px rgba(255, 133, 161, 0.4);
}

.username {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #00e676;
    border-radius: 50%;
    margin-top: 4px;
    box-shadow: 0 0 8px #00e676;
}

/* --- MENU --- */
.menu-list {
    list-style: none;
    flex-grow: 1;
}

.menu-link {
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    text-decoration: none;
    color: var(--text-muted);
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.menu-link:hover {
    background: var(--hover-item);
    color: var(--accent);
    padding-left: 25px; /* Przesunięcie tekstu */
}

.menu-link:hover .icon {
    animation: wiggle 0.5s ease-in-out; /* Ikonka macha */
}

.menu-link.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 5px 20px rgba(255, 133, 161, 0.4);
    border-color: var(--accent);
}

.menu-link .icon {
    font-size: 1.3rem;
    transition: transform 0.3s;
}

/* --- FOOTER & BUTTONS --- */
.sidebar-footer {
    padding-top: 20px;
    border-top: 2px solid var(--border);
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-icon {
    background: var(--hover-item);
    border: 2px solid var(--border);
    color: var(--text-main);
    width: 45px;
    height: 45px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-icon:hover {
    background: var(--accent) !important;
    color: white;
    border-color: var(--accent) !important;
    transform: rotate(15deg) scale(1.1);
    box-shadow: var(--glow);
}

.btn-logout {
    flex-grow: 1;
    background: var(--accent-secondary);
    color: white;
    text-decoration: none;
    text-align: center;
    padding: 10px;
    border-radius: 15px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 0px #8e54e9; /* Efekt grubego przycisku */
}

.btn-logout:active {
    transform: translateY(3px);
    box-shadow: none;
}

/* --- MAIN CONTENT --- */
.main-content {
    flex-grow: 1;
    background: var(--content-bg);
}

.top-bar {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background: var(--sidebar-bg);
    border-bottom: 2px solid var(--border);
}

#current-title {
    font-family: 'Fredoka', sans-serif;
    color: var(--accent);
    font-size: 1.4rem;
}

.status-pill {
    padding: 6px 16px;
    border-radius: 50px;
    background: rgba(0, 230, 118, 0.1);
    color: #00e676;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid rgba(0, 230, 118, 0.2);
}

.iframe-wrapper {
    height: 100vh;
    padding: 25px;
    background: var(--bg-color);
}

iframe {
    width: 100%;
    height: 100%;
    border: 2px solid var(--border);
    border-radius: 30px;
    background: var(--sidebar-bg);
    box-shadow: var(--shadow);
}

/* --- NOWE ELEMENTY DASHBOARDU --- */

.dashboard-body {
    display: block; /* Nadpisujemy flexa z podstawy body, aby layout płynął w dół */
    overflow-y: auto;
    background-image: 
        radial-gradient(at 0% 0%, var(--hover-item) 0, transparent 50%),
        radial-gradient(at 100% 100%, var(--border) 0, transparent 50%);
}

/* --- NAWIGACJA --- */
nav {
    height: 70px;
    background: var(--sidebar-bg);
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent);
}

.nav-right {
    display: flex;
    align-items: center;
}

/* --- LAYOUT --- */
.container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

/* --- EFEKT SZKŁA (GLASSMORPHISM) --- */
.glass {
    background: var(--sidebar-bg);
    backdrop-filter: blur(15px);
    border: 2px solid var(--border);
    border-radius: 25px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.card {
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

/* --- TYPOGRAFIA --- */
.gradient-text {
    font-family: 'Fredoka', sans-serif;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2.5rem;
}

h3 {
    font-family: 'Fredoka', sans-serif;
    color: var(--accent);
    margin-bottom: 15px;
}

/* --- PRZYCISKI --- */
.btn-sm {
    padding: 6px 15px;
    border-radius: 12px;
    background: transparent;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

.btn-sm:hover {
    background: #ff4d4d;
    color: white !important;
}

.btn-main {
    background: var(--accent);
    color: white;
    text-decoration: none;
    padding: 15px;
    border-radius: 20px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    box-shadow: 0 4px 0px var(--accent-hover);
    transition: 0.2s;
}

.btn-main:active {
    transform: translateY(3px);
    box-shadow: none;
}

.btn-outline {
    border: 2px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
    border-radius: 15px;
    font-weight: 700;
    display: inline-block;
    transition: 0.2s;
}

.btn-outline:hover {
    background: var(--accent);
    color: white;
}

/* --- ANIMACJE (Reveal) --- */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Poprawka koloru tekstu w nawigacji dla ciemnego motywu */
body:not(.light-mode) .nav-right span {
    color: var(--text-main) !important;
}

/* Efekt najechania na ikonę zębatki/resetu */
/* .btn-icon:hover {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    transform: rotate(90deg);
} */



/* Stylizacja paska przewijania dla gridu odcinków (jeśli jest ich dużo) */
.card-body {
    max-height: 600px;
    overflow-y: auto;
}

.card-body::-webkit-scrollbar {
    width: 4px;
}

.card-body::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}

.card-body::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
} 

/* --- GLOBALNE SCROLLBARY OPARTE NA TWOICH KOLORACH --- */

/* 1. Szerokość paska (pion i poziom) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

/* 2. Tło paska - ustawiamy na przezroczyste, by nie psuć efektu glassmorphismu */
::-webkit-scrollbar-track {
    background: transparent;
}

/* 3. Suwak (Thumb) */
::-webkit-scrollbar-thumb {
    /* Używamy koloru tekstu muted z niską przezroczystością jako domyślny stan */
    background: var(--text-muted);
    opacity: 0.3; /* Uwaga: opacity nie zawsze działa na thumb, więc lepiej rgba */
    background-color: rgba(171, 166, 191, 0.3); /* Domyślnie dopasowane do Dark Mode */
    
    border-radius: 20px;
    border: 2px solid transparent;
    background-clip: content-box;
    transition: all 0.3s ease;
}

/* 4. Dostosowanie suwaka w trybie jasnym (Strawberry Milk) */
body.light-mode ::-webkit-scrollbar-thumb {
    background-color: rgba(142, 130, 154, 0.3); /* Twoje --text-muted w Light Mode */
}

/* 5. Stan Hover - Sakura Pink! 🌸 */
::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent) !important; /* Zawsze używa Twojego Sakura Pink */
    background-clip: border-box; /* Rozszerza się nieco przy najechaniu */
}

/* --- FIREFOX SUPPORT --- */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) transparent;
}

body.light-mode * {
    scrollbar-color: var(--text-muted) transparent;
}

/* --- STYLIZACJA SCROLLBARA --- */

/* Cały pasek */
.sidebar::-webkit-scrollbar {
    width: 6px; /* Cienki pasek */
}

/* Tło paska (track) */
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

/* Uchwyt paska (thumb) */
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1); /* Delikatny biały dla Dark Mode */
    border-radius: 10px;
    transition: background 0.3s ease;
}

/* Uchwyt po najechaniu */
.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--accent); /* Zmienia się na kolor akcentu przy scrollowaniu */
}

/* Wersja dla Light Mode (jeśli body ma klasę light-mode) */
.light-mode .sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
}

/* --- KONFIGURACJA PRZEWIJANIA SIDEBARU --- */
.sidebar {
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Włącz przewijanie pionowe */
    overflow-x: hidden; /* Wyłącz poziome */
    scrollbar-width: thin; /* Dla Firefox */
    scrollbar-color: var(--accent) transparent; /* Dla Firefox */
}

/* Aby stopka sidebaru była zawsze na dole, ale nie "pływała" nad menu */
.menu-list {
    flex-grow: 1; /* Menu zajmuje tyle miejsca, ile może */
}

.sidebar-footer {
    margin-top: auto; /* Popycha stopkę na dół */
    padding-top: 20px;
    background: inherit; /* Spójność tła */
    position: sticky; /* Opcjonalnie: stopka zawsze widoczna na dole */
    bottom: 0;
}