/* home-styles.css */
:root {
    --bg-color: #1a1b26;
    --card-color: #24283b;
    --border-color: #414868;
    --text-color: #c0caf5;
    --text-hover: #ffffff;
    --accent-color: #7aa2f7;
    --danger-color: #f7768e;
    --info-color: #17a2b8; /* For ToonHQ button */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-color);
    padding: 10px 30px;
    border-bottom: 1px solid var(--border-color);
    min-height: 60px;
    position: relative; /* Positioning context for the nav tabs */
}

.logo img {
    height: 60px;
    display: block;
}

.logo {
    font-size: 1.5em;
    font-weight: bold;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-search {
    display: flex;
    align-items: center;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
}
.header-search input {
    background: none;
    border: none;
    color: var(--text-color);
    padding: 8px 12px;
    outline: none;
    width: 150px;
    transition: width 0.3s ease;
}
.header-search input:focus {
    width: 220px;
}
.header-search button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.header-search svg {
    width: 20px;
    height: 20px;
    fill: var(--text-color);
    opacity: 0.7;
    transition: opacity 0.3s;
}
.header-search button:hover svg {
    opacity: 1;
}

.toonhq-button, .panel-button, .logout-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.toonhq-button {
    background-color: var(--info-color);
    color: #fff;
}
.toonhq-button:hover {
    background-color: #117a8b;
}

.profile-link img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    transition: border-color 0.3s;
}
.profile-link:hover img {
    border-color: var(--accent-color);
}

.panel-button {
    background-color: var(--accent-color);
    color: #fff;
}
.panel-button:hover {
    background-color: #5a82e6;
}

.logout-button {
    background-color: var(--danger-color);
    color: #fff;
}
.logout-button:hover {
    background-color: #d15d6e;
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.card {
    background-color: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.card-header {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 15px 20px;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.1em;
}

.welcome-card {
    padding: 30px;
}
.welcome-card h1 {
    margin-top: 0;
    font-size: 2em;
    color: var(--text-hover);
}
.welcome-card p {
    font-size: 1.1em;
    opacity: 0.8;
    margin-bottom: 25px;
}

.search-box {
    display: flex;
}
.search-box input {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px 0 0 5px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 1em;
    outline: none;
}
.search-box button {
    padding: 12px 20px;
    border: 1px solid var(--accent-color);
    background-color: var(--accent-color);
    color: white;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    font-size: 1em;
}

.report-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.report-list li {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}
.report-list li:last-child {
    border-bottom: none;
}
.report-list .report-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.report-list .report-info strong {
    color: var(--text-hover);
}
.report-list .report-meta {
    font-size: 0.8em;
    opacity: 0.7;
    margin-top: 8px;
}
.report-list .no-reports {
    text-align: center;
    opacity: 0.7;
    padding: 30px;
}

.nav-tabs {
    display: flex;
    gap: 1rem;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.nav-tab {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: bold;
    transition: transform 0.2s ease-in-out, background-color 0.2s ease-in-out;
    position: relative;
    padding-right: 18px;
}

.nav-tab:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 0;
    background-color: var(--danger-color, #f7768e);
    color: white;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 0.75rem;
    font-weight: bold;
    line-height: 1.2;
}

/* Base styles for mobile menu structure (hidden on desktop) */
.mobile-menu-button {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-button svg {
    width: 28px;
    height: 28px;
    fill: var(--text-color);
}


/* =================================================================== */
/* --- ALL MOBILE & TABLET STYLES (900px and below) --- */
/* =================================================================== */
@media (max-width: 900px) {

    /* --- 1. FIX CONTENT OVERFLOW & PADDING --- */
    /* This ensures boxes with padding fit inside the screen */
    .container, .card {
        box-sizing: border-box;
    }

    /* Reduce padding on mobile to give content more space */
    .container {
        padding: 0 15px;
        margin-top: 20px;
    }
    .welcome-card {
        padding: 20px;
    }


    /* --- 2. HEADER & HAMBURGER MENU LAYOUT --- */
    .top-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .header-main {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* Show the hamburger button */
    .mobile-menu-button {
        display: block;
    }

    /* Hide nav tabs and actions by default */
    .nav-tabs, .header-actions {
        display: none; /* Hide until menu is opened */
        flex-direction: column;
        width: 100%;
        text-align: center;
        gap: 0;
    }

    /* Show the menu items when '.is-open' is added by JavaScript */
    .nav-tabs.is-open, .header-actions.is-open {
        display: flex;
    }
    
    /* Reset desktop nav styles */
    .nav-tabs {
        position: static;
        transform: none;
        padding-top: 10px;
    }
    
    /* Style all menu links for vertical layout */
    .nav-tab, .logout-button, .panel-button, .toonhq-button, .profile-link {
        padding: 14px;
        border-radius: 0;
        border-top: 1px solid var(--border-color);
        justify-content: center;
    }
    .profile-link {
        order: -1; /* Puts profile link at the top of its section */
    }
    .notification-badge {
        position: static;
        margin-left: 8px;
    }

    /* Hide desktop-only elements */
    .header-search {
        display: none;
    }


    /* --- 3. MAIN CONTENT LAYOUT --- */
    /* Stack the main content and sidebar vertically */
    .main-grid {
        grid-template-columns: 1fr;
    }

    /* Adjust font sizes for better readability on small screens */
    .welcome-card h1 {
        font-size: 1.6em;
    }
    .welcome-card p {
        font-size: 1em;
    }
}