/* public/nav.css - Premium Fixed Bottom Nav + Colorful Sidebar (Villain Red Theme) */

body {
    padding-bottom: 80px !important; /* Adjusted for taller nav */
}

:root {
    --nav-bg: rgba(18, 18, 18, 0.95); /* Darker, slightly transparent */
    --nav-border: #333;
    --nav-text: #888;
    --nav-active: #ff2a2a; /* Villain Red (Vibrant) */
    --sidebar-bg: #0f0f0f;
    --sidebar-width: 300px;
    --primary-gradient: linear-gradient(135deg, #8b0000, #ff0000); /* Dark Red to Bright Red Gradient */
}

/* --- Bottom Navigation (Fixed & Taller) --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 75px; /* Taller height */
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--nav-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    padding-bottom: 5px; /* Visual balance */
}

.nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--nav-text);
    text-decoration: none;
    flex: 1;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.nav-item .nav-icon {
    font-size: 1.4rem; /* Bigger icons */
    margin-bottom: 4px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy pop */
}

.nav-item .nav-text {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: opacity 0.3s ease;
}

/* Active State */
.nav-item.active {
    color: var(--nav-active);
}

.nav-item.active .nav-icon {
    transform: translateY(-4px) scale(1.1);
    text-shadow: 0 0 15px rgba(255, 42, 42, 0.6); /* Red Glow */
}

/* --- Center Menu Button (Premium Look - BIGGER) --- */
.nav-item[data-target="menu"] {
    transform: translateY(-25px); /* Float significantly higher */
    z-index: 1001; /* Ensure it stays on top */
}

.nav-item[data-target="menu"] .nav-icon {
    background: var(--primary-gradient);
    width: 65px; /* Bigger width */
    height: 65px; /* Bigger height */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.8rem; /* Bigger icon */
    box-shadow: 0 8px 20px rgba(255, 0, 0, 0.5); /* Stronger shadow */
    border: 4px solid #121212; /* Thicker border to mask nav bg */
    margin-bottom: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item[data-target="menu"] .nav-text {
    margin-top: 6px;
    color: #fff;
    font-weight: 600;
    opacity: 0.9;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    position: absolute; /* Position absolute to not affect layout */
    bottom: -20px; /* Push text below the button */
    width: 100%;
    text-align: center;
}

.nav-item[data-target="menu"]:active .nav-icon {
    transform: scale(0.95);
    box-shadow: 0 4px 10px rgba(255, 0, 0, 0.4);
}

.nav-indicator { display: none; }

/* --- Sidebar / Drawer (Animated) --- */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px); /* Blur the background content */
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-menu {
    position: fixed;
    top: 0;
    left: -100%; /* Hidden */
    width: var(--sidebar-width);
    height: 100%;
    background: var(--sidebar-bg);
    z-index: 1002;
    /* Custom Bezier for smooth "premium" slide */
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); 
    transform: translateX(0); /* Default state (handled by left property usually, but let's use transform) */
    box-shadow: 5px 0 25px rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
    overflow: hidden;
    
    /* Subtle texture pattern to reduce "plainness" */
    background-image: 
        linear-gradient(rgba(15, 15, 15, 0.9), rgba(15, 15, 15, 0.9)),
        url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23222222' fill-opacity='0.4' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
}

.sidebar-menu.active {
    transform: translateX(100%); /* Moves from left:-300px to 0 basically */
    left: calc(var(--sidebar-width) * -1); /* Reset position logic */
}

/* Sidebar Header */
.sidebar-header {
    padding: 30px 25px;
    background: linear-gradient(180deg, rgba(30,30,30,1) 0%, rgba(18,18,18,0) 100%);
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-brand {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.sidebar-brand img {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Sidebar List */
.sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: #ccc;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    
    /* Animation Initial State */
    opacity: 0;
    transform: translateX(-20px);
    border-left: 3px solid transparent; /* Prepare for color indicator */
}

.sidebar-item i {
    width: 35px;
    font-size: 1.3rem;
    color: #666; /* Default icon color */
    transition: color 0.2s;
    text-align: center;
}

/* --- Specific Icon Colors & Hover Effects --- */

/* No Sub: Blue/Purple */
.sidebar-item[href*="no-sub"] i { color: #00d2ff; text-shadow: 0 0 10px rgba(0, 210, 255, 0.3); }
.sidebar-item[href*="no-sub"]:hover { background: linear-gradient(90deg, rgba(0, 210, 255, 0.1), transparent); border-left-color: #00d2ff; }

/* Manga: Orange */
.sidebar-item[href*="manga"] i { color: #ff9f43; text-shadow: 0 0 10px rgba(255, 159, 67, 0.3); }
.sidebar-item[href*="manga"]:hover { background: linear-gradient(90deg, rgba(255, 159, 67, 0.1), transparent); border-left-color: #ff9f43; }

/* Request: Green */
.sidebar-item[href*="request"] i { color: #2ecc71; text-shadow: 0 0 10px rgba(46, 204, 113, 0.3); }
.sidebar-item[href*="request"]:hover { background: linear-gradient(90deg, rgba(46, 204, 113, 0.1), transparent); border-left-color: #2ecc71; }

/* Donate: Gold/Yellow */
.sidebar-item[href*="donate"] i { color: #f1c40f; text-shadow: 0 0 10px rgba(241, 196, 15, 0.3); }
.sidebar-item[href*="donate"]:hover { background: linear-gradient(90deg, rgba(241, 196, 15, 0.1), transparent); border-left-color: #f1c40f; }

/* Telegram: Telegram Blue */
.sidebar-item[href*="telegram"] i { color: #0088cc; text-shadow: 0 0 10px rgba(0, 136, 204, 0.3); }
.sidebar-item[href*="telegram"]:hover { background: linear-gradient(90deg, rgba(0, 136, 204, 0.1), transparent); border-left-color: #0088cc; }

/* Donghua: Red/Gold */
.sidebar-item[href*="donghua"] i { color: #ff5252; text-shadow: 0 0 10px rgba(255, 82, 82, 0.3); }
.sidebar-item[href*="donghua"]:hover { background: linear-gradient(90deg, rgba(255, 82, 82, 0.1), transparent); border-left-color: #ff5252; }

/* Default Hover fallback */
.sidebar-item:not([href*="no-sub"]):not([href*="manga"]):not([href*="request"]):not([href*="donate"]):not([href*="telegram"]):hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateX(5px);
}

.sidebar-item:hover {
    color: #fff;
    transform: translateX(5px); /* Subtle hover move */
}

/* Active Link (for current page) */
.sidebar-item.active-link {
    background: linear-gradient(90deg, rgba(255, 42, 42, 0.15), transparent); /* Villain Red tint */
    border-left-color: var(--nav-active);
}
.sidebar-item.active-link i { color: var(--nav-active) !important; } /* Force active icon to red */


/* Sidebar Open Animation (Staggered) */
.sidebar-menu.active .sidebar-item {
    animation: slideInItem 0.4s ease forwards;
}

.sidebar-menu.active .sidebar-item:nth-child(1) { animation-delay: 0.1s; }
.sidebar-menu.active .sidebar-item:nth-child(2) { animation-delay: 0.15s; }
.sidebar-menu.active .sidebar-item:nth-child(3) { animation-delay: 0.2s; }
.sidebar-menu.active .sidebar-item:nth-child(4) { animation-delay: 0.25s; }
.sidebar-menu.active .sidebar-item:nth-child(5) { animation-delay: 0.3s; }
.sidebar-menu.active .sidebar-item:nth-child(6) { animation-delay: 0.35s; }

.sidebar-title {
    padding: 10px 20px;
    color: #888; /* A dimmer color to differentiate from links */
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 15px; /* Add some space above the title */
    margin-bottom: 5px; /* Space between title and first item */
    opacity: 0; /* For entry animation */
    transform: translateX(-20px); /* For entry animation */
}

/* Add animation for the titles as well */
.sidebar-menu.active .sidebar-title {
    animation: slideInItem 0.4s ease forwards;
    animation-delay: 0.05s; /* Make them appear just before the first item */
}

@keyframes slideInItem {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar-divider {
    height: 1px;
    background: #333;
    margin: 15px 10px;
    opacity: 0.5;
}

.sidebar-footer {
    padding: 20px;
    text-align: center;
    font-size: 0.75rem;
    color: #555;
    border-top: 1px solid #222;
}