/* ==========================================================================
   Okuucraft CSS Design System
   Theme: Light Green Accents / Sleek Gaming Glassmorphism
   ========================================================================== */

/* --- Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* --- Theme Variables --- */
:root {
    /* Color Tokens - Light Green Theme */
    --primary-color: #2e7d32;         /* Deep green primary */
    --primary-light: #4caf50;         /* Vibrant light green */
    --primary-dark: #1b5e20;          /* Dark green accent */
    --accent-color: #81c784;          /* Soft green accent */
    --bg-light: #f4fbf5;              /* Light mint bg */
    --card-bg-light: #ffffff;
    --text-dark: #1e293b;             /* Dark slate text */
    --text-muted: #64748b;

    /* Gaming/Gacha Colors (Dark Mode context for simulation) */
    --gacha-bg: #0f172a;              /* Deep slate background */
    --gacha-card-bg: rgba(30, 41, 59, 0.7); /* Translucent glass */
    --gacha-border: rgba(255, 255, 255, 0.08);
    --gold-rarity: #eab308;           /* Elite (5-star) Gold */
    --gold-glow: rgba(234, 179, 8, 0.4);
    --purple-rarity: #a855f7;         /* Standard (4-star) Purple */
    --purple-glow: rgba(168, 85, 247, 0.4);
    --blue-rarity: #3b82f6;           /* Retired (3-star) Blue */
    --blue-glow: rgba(59, 130, 246, 0.2);

    /* UI Measurements */
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.07), 0 4px 6px -4px rgb(0 0 0 / 0.07);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Global Reset & Base Layout
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ==========================================================================
   Navigation Bar (Header Component)
   ========================================================================== */
header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(46, 125, 50, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-dark);
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
}

.logo-accent {
    color: var(--primary-light);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.nav-toggle .bar {
    height: 3px;
    width: 100%;
    background-color: var(--primary-color);
    border-radius: 9px;
    transition: var(--transition-smooth);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(46, 125, 50, 0.06);
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
}

.dropdown-trigger {
    background: transparent;
    border: none;
    color: var(--text-dark);
    font-family: inherit;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-smooth);
}

.dropdown-trigger:hover, .nav-dropdown.active .dropdown-trigger {
    color: var(--primary-color);
    background-color: rgba(46, 125, 50, 0.06);
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.nav-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: 1px solid rgba(46, 125, 50, 0.1);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.6rem;
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition-smooth);
}

.nav-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    padding: 0.8rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-smooth);
}

.dropdown-item:hover {
    background-color: rgba(46, 125, 50, 0.05);
}

.dropdown-item .item-title {
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.95rem;
}

.dropdown-item .item-desc {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.1rem;
}

/* ==========================================================================
   Footer Component
   ========================================================================== */
footer {
    background: #ffffff;
    border-top: 1px solid rgba(46, 125, 50, 0.1);
    padding: 3rem 1.5rem 1.5rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.footer-section h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.footer-section h4 {
    color: var(--primary-dark);
    margin-bottom: 1.2rem;
    font-size: 1rem;
    font-weight: 600;
}

.footer-section p {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 320px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    width: fit-content;
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 4px;
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==========================================================================
   Home Landing Page
   ========================================================================== */
.hero-section {
    text-align: center;
    padding: 4rem 1rem;
    background: linear-gradient(135deg, rgba(234, 250, 236, 0.6) 0%, rgba(200, 235, 204, 0.3) 100%);
    border-radius: var(--border-radius-lg);
    margin-bottom: 3rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(46, 125, 50, 0.05);
}

.hero-section h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: #ffffff;
    text-decoration: none;
    padding: 0.9rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(46, 125, 50, 0.3);
    transition: var(--transition-smooth);
}

.cta-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4);
}

.tools-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.tool-card {
    background: var(--card-bg-light);
    border: 1px solid rgba(46, 125, 50, 0.08);
    border-radius: var(--border-radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(46, 125, 50, 0.2);
}

.tool-card-icon {
    width: 48px;
    height: 48px;
    background: rgba(76, 175, 80, 0.1);
    color: var(--primary-color);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
}

.tool-card h2 {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
}

.tool-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex: 1;
}

.tool-card-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: var(--transition-smooth);
}

.tool-card-link:hover {
    color: var(--primary-dark);
}

/* ==========================================================================
   Page Component: Calculator UI
   ========================================================================== */
.calculator-header-area {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.calculator-title h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.tutorial-btn {
    background: rgba(46, 125, 50, 0.08);
    color: var(--primary-color);
    border: 1px solid rgba(46, 125, 50, 0.2);
    font-family: inherit;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.tutorial-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Sub-Tab Navigation */
.tabs-navigation {
    display: flex;
    border-bottom: 2px solid rgba(46, 125, 50, 0.1);
    margin-bottom: 2rem;
    gap: 1rem;
}

.tab-btn {
    background: transparent;
    border: none;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    position: relative;
    transition: var(--transition-smooth);
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==========================================================================
   TAB 1: Gacha Simulator Area (Sleek Gaming/Dark Mode Styling)
   ========================================================================== */
.gacha-sim-container {
    background-color: var(--gacha-bg);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    color: #f8fafc;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

/* Top control dashboard */
.gacha-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--gacha-border);
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
    backdrop-filter: blur(8px);
}

.dashboard-panel h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.4rem;
}

.select-wrapper select {
    width: 100%;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 0.6rem;
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.select-wrapper select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.pity-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.pity-box {
    display: flex;
    flex-direction: column;
}

.pity-box .value {
    font-size: 1.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--primary-light);
}

.pity-box .label {
    font-size: 0.7rem;
    color: #94a3b8;
}

.guarantee-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    margin-top: 0.3rem;
}

.guarantee-badge.yes {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.guarantee-badge.no {
    background: rgba(148, 163, 184, 0.1);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Gacha Main Stage Area */
.gacha-stage {
    min-height: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    border-radius: var(--border-radius-md);
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.4) 0%, #020617 100%), 
                repeating-linear-gradient(45deg, rgba(76, 175, 80, 0.02) 0px, rgba(76, 175, 80, 0.02) 2px, transparent 2px, transparent 10px);
    border: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
    padding: 2rem;
}

/* Animations stage overlays */
.gacha-overlay-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: rgba(2, 6, 23, 0.95);
    z-index: 5;
    border-radius: var(--border-radius-md);
}

.light-beam {
    width: 6px;
    height: 100%;
    position: absolute;
    opacity: 0;
}

@keyframes laser-glow {
    0% { transform: scaleY(0) rotate(0deg); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: scaleY(1.5) rotate(360deg); opacity: 0; }
}

.pull-animation-portal {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 50px rgba(76, 175, 80, 0.5);
    animation: portal-spin 2s linear infinite;
}

@keyframes portal-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Gacha results grid with vertical columns */
.gacha-results-grid {
    display: flex;
    gap: 0.4rem;
    width: 100%;
    min-height: 380px;
    align-items: stretch;
    z-index: 2;
}

.gacha-pillar {
    flex: 1;
    min-width: 0;
    position: relative;
    border-radius: var(--border-radius-sm);
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.4) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0.2rem 1.5rem;
    overflow: hidden;
    transition: var(--transition-smooth);
}

/* Background vertical light beam overlay */
.pillar-beam {
    position: absolute;
    top: 0;
    left: 15%;
    width: 70%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(59, 130, 246, 0.15), transparent);
    pointer-events: none;
    opacity: 0.5;
    transition: var(--transition-smooth);
}

.gacha-pillar.ssr {
    border-color: rgba(234, 179, 8, 0.4);
    background: linear-gradient(to top, rgba(234, 179, 8, 0.25) 0%, rgba(15, 23, 42, 0.9) 100%);
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.2);
}
.gacha-pillar.ssr .pillar-beam {
    background: linear-gradient(to bottom, transparent, rgba(234, 179, 8, 0.4), transparent);
    opacity: 0.8;
}

.gacha-pillar.sr {
    border-color: rgba(168, 85, 247, 0.4);
    background: linear-gradient(to top, rgba(168, 85, 247, 0.2) 0%, rgba(15, 23, 42, 0.9) 100%);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.15);
}
.gacha-pillar.sr .pillar-beam {
    background: linear-gradient(to bottom, transparent, rgba(168, 85, 247, 0.3), transparent);
    opacity: 0.8;
}

.gacha-pillar.r {
    border-color: rgba(59, 130, 246, 0.15);
    background: linear-gradient(to top, rgba(59, 130, 246, 0.08) 0%, rgba(15, 23, 42, 0.9) 100%);
}
.gacha-pillar.r .pillar-beam {
    background: linear-gradient(to bottom, transparent, rgba(59, 130, 246, 0.1), transparent);
}

/* Pillar Content styling */
.pillar-badge-top {
    font-size: 0.55rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    z-index: 2;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.ssr .pillar-badge-top {
    color: var(--gold-rarity);
    border-color: rgba(234, 179, 8, 0.3);
}
.sr .pillar-badge-top {
    color: var(--purple-rarity);
    border-color: rgba(168, 85, 247, 0.3);
}
.r .pillar-badge-top {
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}

.pillar-graphic {
    font-size: 2.2rem;
    z-index: 2;
    margin: auto 0;
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease;
}
.gacha-pillar:hover .pillar-graphic {
    transform: scale(1.15) translateY(-5px);
}

.pillar-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    z-index: 2;
}

.pillar-name {
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}
.ssr .pillar-name {
    color: #fef08a;
    text-shadow: 0 0 4px rgba(234, 179, 8, 0.4);
}
.sr .pillar-name {
    color: #f3e8ff;
    text-shadow: 0 0 4px rgba(168, 85, 247, 0.4);
}

.pillar-cashback {
    font-size: 0.55rem;
    color: #94a3b8;
    margin-top: 0.2rem;
}

@media (max-width: 600px) {
    .gacha-results-grid {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 0.3rem;
        height: auto;
        min-height: auto;
    }
    .gacha-pillar {
        height: 180px;
        padding: 0.6rem 0.2rem;
    }
    .pillar-graphic {
        font-size: 1.5rem;
    }
    .pillar-name {
        font-size: 0.65rem;
    }
}

/* Empty gacha stage state */
.gacha-stage-empty {
    text-align: center;
    color: #64748b;
}

.gacha-stage-empty .stage-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #334155;
    animation: pulse-slow 3s infinite;
}

@keyframes pulse-slow {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

/* Action controls at bottom */
.gacha-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.pull-btn {
    border: none;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.9rem 2.2rem;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.pull-btn.pull-1x {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pull-btn.pull-1x:hover {
    background: #475569;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pull-btn.pull-10x {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: #ffffff;
}

.pull-btn.pull-10x:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(76, 175, 80, 0.3);
}

/* History Logs & Inventory Slide-in Sidebar */
.sidebar-toggle-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    font-family: inherit;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    z-index: 10;
    transition: var(--transition-smooth);
}

.sidebar-toggle-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-light);
}

.gacha-sidebar {
    position: fixed;
    top: 0;
    right: -360px; /* Hidden offscreen by default */
    width: 360px;
    height: 100%;
    background: #0f172a;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 200;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: #f8fafc;
}

.gacha-sidebar.open {
    right: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.sidebar-close-btn:hover {
    color: #ffffff;
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0 1rem;
}

.sidebar-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #64748b;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.8rem 0;
    cursor: pointer;
    position: relative;
    transition: var(--transition-smooth);
}

.sidebar-tab-btn.active {
    color: var(--primary-light);
}

.sidebar-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 15%;
    width: 70%;
    height: 2px;
    background-color: var(--primary-light);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.sidebar-pane {
    display: none;
}

.sidebar-pane.active {
    display: block;
}

/* Sidebar statistics widget */
.sidebar-stats-widget {
    background: rgba(30, 41, 59, 0.5);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-item .label {
    font-size: 0.65rem;
    color: #94a3b8;
}

.stat-item .value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
}

.stat-item.highlight .value {
    color: #fbbf24;
}

/* Inventory List */
.inventory-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.inventory-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(30, 41, 59, 0.3);
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.inventory-item-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.inventory-item.ssr {
    border-left: 3px solid var(--gold-rarity);
    background: rgba(234, 179, 8, 0.03);
}

.inventory-item.sr {
    border-left: 3px solid var(--purple-rarity);
    background: rgba(168, 85, 247, 0.03);
}

.inventory-item-count {
    background: #1e293b;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    color: var(--primary-light);
}

/* History logs list */
.history-logs-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-log-row {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    background: rgba(30, 41, 59, 0.2);
}

.history-log-row.ssr {
    background: rgba(234, 179, 8, 0.08);
    color: #fef08a;
}

.history-log-row.sr {
    background: rgba(168, 85, 247, 0.08);
    color: #f3e8ff;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.clear-data-btn {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    font-family: inherit;
    font-weight: 600;
    padding: 0.6rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.clear-data-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

/* ==========================================================================
   TAB 2: Gacha Calculator UI (Professional Analytical Style)
   ========================================================================== */
.calculator-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 1024px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
}

.calculator-card {
    background: #ffffff;
    border: 1px solid rgba(46, 125, 50, 0.08);
    border-radius: var(--border-radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.calculator-card h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(76, 175, 80, 0.15);
    color: var(--primary-color);
    font-size: 0.65rem;
    font-weight: bold;
    cursor: help;
}

/* Left Panel - Matrix of Pity Inputs */
.pity-matrix-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.pity-matrix-table th {
    text-align: center;
    padding: 0.8rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    border-bottom: 2px solid rgba(0, 0, 0, 0.06);
}

.pity-matrix-table th.star-column {
    color: var(--primary-dark);
}

.pity-matrix-table td {
    padding: 1rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.pity-matrix-table tr:last-child td {
    border-bottom: none;
}

.pity-matrix-table td.row-header {
    text-align: left;
    font-weight: 700;
    color: var(--text-dark);
    text-transform: capitalize;
}

.pity-input-wrapper {
    display: inline-block;
}

.pity-input-wrapper input[type="number"] {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: var(--border-radius-sm);
    text-align: center;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

.pity-input-wrapper input[type="number"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.1);
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Import/Export buttons */
.data-sync-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.sync-btn {
    flex: 1;
    font-family: inherit;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.sync-btn.import {
    background: #10b981;
    color: white;
    border-color: #059669;
}

.sync-btn.import:hover {
    background: #059669;
}

.sync-btn.export {
    background: #ef4444;
    color: white;
    border-color: #dc2626;
}

.sync-btn.export:hover {
    background: #dc2626;
}

/* Right Panel - Pull Plan Editor */
.pull-plan-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    padding-right: 0.5rem;
}

.pull-plan-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(46, 125, 50, 0.03);
    padding: 0.8rem;
    border-radius: var(--border-radius-sm);
    border: 1px dashed rgba(46, 125, 50, 0.2);
}

.plan-row-icon {
    font-size: 1.3rem;
    color: var(--primary-color);
}

.plan-row-selects {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    flex-wrap: wrap;
}

.plan-row-selects select {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: var(--text-dark);
    padding: 0.4rem;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
}

.plan-row-arrow {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-delete-plan {
    background: transparent;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.btn-delete-plan:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-add-plan {
    width: 100%;
    background: rgba(46, 125, 50, 0.05);
    border: 1px dashed rgba(46, 125, 50, 0.3);
    color: var(--primary-color);
    font-family: inherit;
    font-weight: 600;
    padding: 0.6rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: var(--transition-smooth);
}

.btn-add-plan:hover {
    background: rgba(46, 125, 50, 0.1);
}

.calc-action-buttons {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.calc-btn {
    border: none;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    padding: 0.8rem 1.2rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.calc-btn.primary {
    background: var(--primary-color);
    color: white;
}

.calc-btn.primary:hover {
    background: var(--primary-dark);
}

.calc-btn.stop {
    background: #ef4444;
    color: white;
}

.calc-btn.stop:hover {
    background: #dc2626;
}

/* Visualization Panel (Chart) */
.chart-container-card {
    margin-bottom: 2.5rem;
}

.chart-wrapper {
    position: relative;
    height: 400px;
    width: 100%;
    margin: 1.5rem 0;
}

.chart-controls-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-weight: 600;
    font-size: 0.95rem;
    margin-top: 1rem;
    background: rgba(46, 125, 50, 0.03);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(46, 125, 50, 0.05);
}

.chart-controls-bar input[type="number"] {
    width: 80px;
    padding: 0.3rem 0.5rem;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    font-family: inherit;
    font-weight: bold;
    outline: none;
}

.chart-controls-bar input[type="number"]:focus {
    border-color: var(--primary-color);
}

/* Expectation Reference Tables (Screenshot 2 style) */
.expected-rolls-card {
    background: #ffffff;
    border: 1px solid rgba(46, 125, 50, 0.08);
    border-radius: var(--border-radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.expected-table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
}

.expected-rolls-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: center;
}

.expected-rolls-table th {
    background: var(--primary-dark);
    color: #ffffff;
    padding: 0.8rem 0.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.expected-rolls-table td {
    padding: 0.7rem 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.expected-rolls-table tr:nth-child(even) {
    background-color: rgba(46, 125, 50, 0.02);
}

.expected-rolls-table td.header-column {
    font-weight: 700;
    color: var(--primary-dark);
    background: rgba(46, 125, 50, 0.04);
}

.expected-rolls-table td.highlight-column {
    font-weight: 700;
    background: rgba(251, 191, 36, 0.04);
    color: #b45309;
}

/* Expected Table Section Headers */
.table-section-title {
    margin-top: 1.5rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    color: var(--text-dark);
    font-weight: 700;
    background: rgba(0,0,0,0.02);
    padding: 0.4rem 0.8rem;
    border-left: 4px solid var(--primary-light);
}

/* ==========================================================================
   Advanced Settings Collapsible for Cashback custom rates
   ========================================================================== */
.advanced-settings-wrapper {
    margin-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 1rem;
}

.advanced-trigger {
    background: transparent;
    border: none;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.advanced-trigger:hover {
    color: var(--primary-color);
}

.advanced-trigger-arrow {
    transition: transform 0.3s ease;
}

.advanced-settings-wrapper.open .advanced-trigger-arrow {
    transform: rotate(90deg);
}

.advanced-content {
    display: none;
    margin-top: 1rem;
    background: rgba(0,0,0,0.02);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.advanced-settings-wrapper.open .advanced-content {
    display: grid;
}

.setting-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.setting-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.setting-field input[type="number"] {
    padding: 0.4rem;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        border-bottom: 1px solid rgba(46, 125, 50, 0.1);
        padding: 1.5rem;
        flex-direction: column;
        gap: 1rem;
        box-shadow: var(--shadow-md);
        display: none;
    }
    
    .nav-menu.open {
        display: flex;
    }
    
    .nav-dropdown {
        width: 100%;
    }
    
    .dropdown-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        padding-left: 1.5rem;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        margin-top: 0.5rem;
    }
    
    .nav-dropdown.active .dropdown-menu {
        display: block;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .gacha-sidebar {
        width: 100%;
        right: -100%;
    }
}

/* ==========================================================================
   Follow-Up: Simplified Slide Down Gacha Animations
   ========================================================================== */
@keyframes slideDownFade {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-down-fade-anim {
    animation: slideDownFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

@keyframes flashGold {
    0% { box-shadow: inset 0 0 80px rgba(234, 179, 8, 0.5); }
    100% { box-shadow: none; }
}
@keyframes flashPurple {
    0% { box-shadow: inset 0 0 60px rgba(168, 85, 247, 0.5); }
    100% { box-shadow: none; }
}
@keyframes flashBlue {
    0% { box-shadow: inset 0 0 40px rgba(59, 130, 246, 0.3); }
    100% { box-shadow: none; }
}

.stage-flash-gold {
    animation: flashGold 0.8s ease-out;
}
.stage-flash-purple {
    animation: flashPurple 0.8s ease-out;
}
.stage-flash-blue {
    animation: flashBlue 0.8s ease-out;
}

/* ==========================================================================
   Dark Theme Configuration & Style Overrides
   ========================================================================== */
body.dark-theme {
    --bg-light: #0f172a;               /* Slate 900 */
    --card-bg-light: #1e293b;          /* Slate 800 */
    --text-dark: #f8fafc;              /* Slate 50 */
    --text-muted: #94a3b8;             /* Slate 400 */
    --primary-dark: #81c784;           /* Light green accent for readability */
    --primary-color: #4caf50;          /* Bright primary green */
    
    background-color: var(--bg-light);
    color: var(--text-dark);
}

body.dark-theme header {
    background: rgba(30, 41, 59, 0.85);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

body.dark-theme .nav-link,
body.dark-theme .dropdown-trigger {
    color: #f8fafc;
}

body.dark-theme .nav-link:hover,
body.dark-theme .dropdown-trigger:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--primary-dark);
}

body.dark-theme .dropdown-menu {
    background-color: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

body.dark-theme .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

body.dark-theme .dropdown-item .item-title {
    color: var(--primary-dark);
}

body.dark-theme footer {
    background: #1e293b;
    border-top-color: rgba(255, 255, 255, 0.05);
}

body.dark-theme .tool-card,
body.dark-theme .calculator-card,
body.dark-theme .expected-rolls-card {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body.dark-theme .pity-matrix-table th {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .pity-matrix-table td {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

body.dark-theme .pity-input-wrapper input[type="number"],
body.dark-theme .plan-row-selects select,
body.dark-theme .chart-controls-bar input[type="number"] {
    background-color: #0f172a;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.15);
}

body.dark-theme .pull-plan-row {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .expected-rolls-table td {
    border-color: rgba(255, 255, 255, 0.05);
}

body.dark-theme .expected-rolls-table td.header-column {
    background: rgba(255, 255, 255, 0.03);
    color: var(--primary-dark);
}

body.dark-theme .expected-rolls-table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.01);
}

body.dark-theme .table-section-title {
    background-color: rgba(255, 255, 255, 0.01);
}

body.dark-theme .chart-controls-bar {
    background-color: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
}

body.dark-theme .advanced-content {
    background-color: rgba(255, 255, 255, 0.02);
}

body.dark-theme .advanced-settings-wrapper {
    border-top-color: rgba(255, 255, 255, 0.05);
}

body.dark-theme .theme-toggle-btn {
    color: #facc15 !important;
}

.theme-toggle-btn:hover {
    background-color: rgba(46, 125, 50, 0.08) !important;
}

body.dark-theme .theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

