/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #0e121f;
    color: #e2e8f0;
}

/* Dashboard Layout */
#dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
#sidebar {
    width: 220px;
    background: #1a1f33;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    color: #38bdf8;
    font-weight: 700;
    font-size: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-menu .menu-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #cbd5e1;
}

.sidebar-menu .menu-item.active,
.sidebar-menu .menu-item:hover {
    background: #2b3350;
    color: #38bdf8;
}

/* Main Content */
#main-content {
    flex: 1;
    padding: 24px;
}

.content-section {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.content-section.active {
    display: flex;
}

.content-section h2 {
    color: #38bdf8;
    font-size: 22px;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

/* Card Design */
.card {
    background: #1f273b;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}

.card-header {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #facc15;
}

/* Card Paragraph */
.card p {
    font-size: 14px;
    color: #cbd5e1;
    margin-bottom: 12px;
}

/* Card Button */
.card-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #38bdf8;
    color: #1f273b;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.card-btn:hover {
    background: #22a3f0;
    transform: translateY(-2px);
}

.visitors-badge {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: #0f172a;
    color: #e2e8f0;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    border: 1px solid #1e293b;
}

/* Optional hover effect */
.card:hover .visitors-badge {
    background: #1e293b;
}

/* Status Indicators */
.status {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: #334155;
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
}

.status::before {
    content: "●";
    margin-right: 6px;
}

.status-online {
    background: #166534;
    color: #bbf7d0;
}

.status-online::before {
    color: #22c55e;
}

.status-offline {
    background: #7f1d1d;
    color: #fecaca;
}

.status-offline::before {
    color: #ef4444;
}

.status-loading {
    background: #78350f;
    color: #fde68a;
    animation: pulse 1.5s infinite;
}

.status-loading::before {
    color: #f59e0b;
}

@keyframes pulse {
    0%,100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Responsive */
@media (max-width: 1024px) {
    #dashboard {
        flex-direction: column;
    }
    #sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding: 10px;
        gap: 8px;
    }
    .sidebar-menu {
        flex-direction: row;
        gap: 8px;
    }
    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

.media-card {
    position: relative;
    border-radius: 15px;
    padding: 16px 20px 20px 20px; /* leave top padding for color bar */
    background: #1f273b;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Top color bar */
.media-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    background: #ccc; /* default, overridden by type */
}

/* Media Header: Emoji + Title */
.media-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 16px;
}

/* Emoji */
.media-emoji {
    font-size: 20px;
}

.media-card.movies::before { background: #f59e0b; }
.media-card.series::before { background: #3b82f6; }
.media-card.anime::before { background: #ec4899; }
.media-card.manga::before { background: #10b981; }
.media-card.comics::before { background: #f87171; }
.media-card.books::before { background: #8b5cf6; }
.media-card.documentaries::before { background: #14b8a6;}

/* Status at bottom */
.media-card .status {
    margin-top: auto; /* sticks to bottom */
}
