/**
 * @file styles.css
 * Wise Goblin Hub & DropLogic - Theme & Layout
 */

/* ==========================================
   CSS VARIABLES (DESIGN TOKENS)
   ========================================== */
:root {
    /* Base Colors */
    --bg: #0c0a09;
    --card: rgba(28, 25, 23, 0.95);
    --border: #44403c;
    
    /* Accents */
    --accent-green: #84cc16;
    --accent-orange: #f97316;
    --glow-green: rgba(132, 204, 22, 0.2);
    
    /* Typography Colors */
    --text: #f5f5f4;
    --text-dim: #a8a29e;

    /* Chart Stats (Matches app.js COLORS) */
    --stat-mode: #ef4444;
    --stat-progress: #3b82f6;
    --stat-mean: #f97316;
    --stat-user: #22c55e;

    /* Fonts */
    --font-primary: 'Montserrat', sans-serif;
    --font-mono: 'Inter', sans-serif;
}

/* ==========================================
   RESET & FOUNDATION
   ========================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 10% 10%, rgba(132, 204, 22, 0.07) 0%, transparent 50%),
        radial-gradient(circle at 90% 90%, rgba(249, 115, 22, 0.07) 0%, transparent 50%);
    color: var(--text);
    font-family: var(--font-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Base Typography */
h1, h2, h3 { 
    font-family: var(--font-primary);
    margin: 0; 
    font-weight: 700; 
    letter-spacing: 0.05em; 
    text-transform: uppercase; 
    color: var(--accent-green); 
}

h1 { font-size: 2.5rem; }

ol, p {
    font-family: var(--font-primary);
    line-height: 1.6;
}

.subtitle { 
    font-family: var(--font-mono);
    color: var(--accent-orange); 
    font-size: 0.8rem; 
    font-weight: 800; 
    text-transform: uppercase; 
    letter-spacing: 0.2em; 
}

.hidden { display: none !important; }

/* ==========================================
   VIEW TRANSITIONS & ANIMATIONS
   ========================================== */
.hidden-view { display: none !important; }

.active-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    animation: fadeIn 0.3s ease forwards;
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
    pointer-events: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* ==========================================
   HERO SHOWCASE (Landing View)
   ========================================== */
#hero-view {
    min-height: 100vh;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.hero-backdrop {
    position: absolute;
    inset: 0; /* Modern shorthand for top:0; right:0; bottom:0; left:0; */
    z-index: -1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
}

.green-orb {
    width: 50vw; height: 50vh;
    background-color: var(--accent-green);
    transform: translate(-20%, -10%);
}

.orange-orb {
    width: 40vw; height: 40vh;
    background-color: var(--accent-orange);
    transform: translate(20%, 10%);
}

.logo-pedestal {
    z-index: 10;
    margin-bottom: 20px;
}

.showcase-logo {
    height: 60vh;
    max-height: 600px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0px 0px 2px #000000) 
            drop-shadow(0px 0px 2px #000000) 
            drop-shadow(0px 0px 2px #000000);
}

.hero-titles {
    text-align: center;
    margin-bottom: 40px;
    z-index: 10;
}

.hero-titles h1 {
    font-size: 4rem;
    font-weight: 900;
    text-shadow: none; 
}

.hero-titles .subtitle { 
    margin-top: 5px; 
}

/* ==========================================
   NAVIGATION & BUTTONS
   ========================================== */
.premium-nav {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 10;
}

/* Tactical Intelligence V2 Buttons */
.premium-btn, .premium-btn-sm {
    font-family: var(--font-primary);
    text-decoration: none; 
    display: inline-flex;  
    align-items: center;
    justify-content: center;
    position: relative;
    
    background: #1c1917;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid rgba(0, 0, 0, 0.5);
    
    color: var(--text-dim) !important;
    padding: 14px 28px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: all 0.2s ease-out;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

.premium-btn-sm { 
    padding: 10px 20px; 
    font-size: 11px; 
}

.premium-btn:hover, .premium-btn-sm:hover {
    color: #fff !important;
    background: #23201d;
    border-top-color: var(--accent-green);
    transform: translateY(-2px);
    box-shadow: 
        0 0 15px var(--glow-green),
        0 12px 20px rgba(0, 0, 0, 0.6);
}

.premium-btn:active, .premium-btn-sm:active {
    transform: translateY(2px);
    transition: 0.05s;
}

.btn-sm { 
    font-family: var(--font-primary);
    background: var(--border); 
    color: var(--text); 
    border: none; 
    padding: 8px 16px; 
    border-radius: 4px; 
    font-size: 11px; 
    font-weight: 700; 
    cursor: pointer; 
    text-transform: uppercase; 
}

.food-row a {
    display: inline-block;
    background: rgba(20, 18, 16, 0.8);
    color: var(--text);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.9em;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
}

.food-row a:hover {
    background: rgba(132, 204, 22, 0.05); /* Faint Bandos green background */
    border-color: var(--accent-green);
    color: var(--accent-green);
    transform: translateY(-1px); /* Slight lift effect */
    box-shadow: 0 2px 8px rgba(132, 204, 22, 0.15);
}

/* ==========================================
   CONTENT HEADER & TAB SYSTEM
   ========================================== */
.content-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(12, 10, 9, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.mini-nav { display: flex; gap: 10px; }

.tab-link {
    font-family: var(--font-primary);
    background: transparent;
    color: var(--text-dim);
    border: none;
    padding: 8px 16px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
    border-radius: 4px;
}

.tab-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.tab-link.active { color: var(--accent-green); background: var(--glow-green); }

.tab-panel { display: none; width: 100%; }
.tab-panel.active-panel { display: block; animation: fadeIn 0.3s ease forwards; }

/* ==========================================
   MAIN LAYOUT COMPONENTS
   ========================================== */
.container { 
    width: 100%; 
    max-width: 850px; 
    padding: 40px 20px;
}

header { 
    margin-bottom: 40px; 
    border-bottom: 1px solid var(--border); 
    padding-bottom: 20px; 
    text-align: left;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.header-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px; 
}

.controls { display: flex; gap: 10px; }

/* ==========================================
   FORMS & INPUTS
   ========================================== */
.input-row { 
    display: grid; 
    grid-template-columns: 1.2fr 1fr; 
    gap: 24px; 
    margin-bottom: 24px; 
}

label { 
    font-family: var(--font-primary);
    font-size: 11px; 
    font-weight: 800; 
    color: var(--text-dim); 
    text-transform: uppercase; 
    letter-spacing: 0.1em; 
    margin-bottom: 10px; 
    display: block; 
}

select, input {
    width: 100%; 
    padding: 14px; 
    background: #110f0e; 
    border: 1px solid var(--border);
    border-radius: 8px; 
    color: white; 
    font-size: 15px; 
    font-family: var(--font-mono);
    box-sizing: border-box; 
    transition: 0.2s;
}

input[type=number] {
    text-align: center;
    font-feature-settings: "tnum"; 
    appearance: textfield; /* Standard property for hiding arrows */
    font-weight: 800;
}

/* Remove Spinners (Arrows) from Number Input */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none; 
    margin: 0;
}

.kc-controls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.kc-btn {
    flex: 1; 
    min-width: 42px; 
    background: #1c1917; 
    border: 1px solid var(--border);
    color: var(--text-dim); 
    padding: 8px 0; 
    font-size: 10px; 
    font-family: var(--font-mono);
    font-weight: 700; 
    border-radius: 4px; 
    cursor: pointer; 
    transition: 0.2s; 
    font-feature-settings: "tnum";
}

.kc-btn:hover { background: var(--border); color: var(--text); }
.kc-btn.reset { color: #ef4444; border-color: rgba(239, 68, 68, 0.3); }

/* The Big Submit Button */
button#calculate-btn {
    width: 100%; 
    padding: 22px; 
    background: linear-gradient(180deg, #fb923c 0%, var(--accent-orange) 10%, #c2410c 100%);
    border: 1px solid rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px; 
    color: #fff; 
    font-family: var(--font-primary);
    font-weight: 800; 
    font-size: 1.1rem; 
    text-transform: uppercase;
    letter-spacing: 0.2em; 
    cursor: pointer; 
    -webkit-font-smoothing: antialiased;
    box-shadow: 0 6px 0 #9a3412, 0 12px 25px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: translateY(0);
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

button#calculate-btn:hover { 
    transform: translateY(-2px);
    background: linear-gradient(180deg, #fdba74 0%, var(--accent-orange) 15%, #ea580c 100%);
    box-shadow: 0 8px 0 #9a3412, 0 15px 35px rgba(249, 115, 22, 0.25);
}

button#calculate-btn:active {
    transform: translateY(4px); 
    box-shadow: 0 2px 0 #9a3412, 0 5px 10px rgba(0, 0, 0, 0.5);
    transition: 0.10s;
}

button#calculate-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,0.05) 50%, transparent 50%);
    background-size: 100% 4px;
    pointer-events: none;
    opacity: 0.3;
}

/* ==========================================
   DROPLOGIC APP COMPONENTS
   ========================================== */
.item-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); 
    gap: 10px; 
}

.item-box {
    aspect-ratio: 1; 
    background: #110f0e; 
    border: 1px solid var(--border); 
    border-radius: 6px;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    padding: 8px;
    transition: transform 0.1s, border-color 0.2s;
}

.item-box:hover { transform: scale(1.05); }
.item-box img { width: 32px; height: 32px; object-fit: contain; pointer-events: none; }
.item-box.selected { border-color: var(--accent-green); background: var(--glow-green); box-shadow: 0 0 10px var(--glow-green); }

.chart-wrapper {
    width: 100%; height: 500px; margin: 20px 0; background: rgba(17, 15, 14, 0.6);
    border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-sizing: border-box;
    backdrop-filter: blur(4px);
}

.result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
#stat-chance { font-size: 3.5rem; font-weight: 900; color: var(--accent-green); font-family: var(--font-mono); font-feature-settings: "tnum"; line-height: 1; }
.prob-label { font-family: var(--font-primary); font-size: 10px; color: var(--accent-orange); font-weight: 800; text-align: right; text-transform: uppercase; }

.stats-list { display: flex; flex-direction: column; gap: 10px; }

.stat-item { 
    padding: 15px; 
    background: rgba(255,255,255,0.02); 
    border-radius: 8px; 
    border-left: 5px solid var(--border); 
    color: var(--text-dim); 
    font-size: 14px; 
    font-family: var(--font-primary);
}

.stat-item b { color: var(--accent-green); font-family: var(--font-mono); font-feature-settings: "tnum"; }

#phrase-mode { border-left-color: var(--stat-mode); }
#phrase-median { border-left-color: var(--stat-progress); }
#phrase-mean { border-left-color: var(--stat-mean); }
#phrase-user { border-left-color: var(--stat-user); }

/* ==========================================
   GUIDES & FAQ COMPONENTS
   ========================================== */
.category-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.25em;
    color: var(--accent-orange);
    text-transform: uppercase;
    margin: 35px 0 20px 0;
    padding-left: 10px;
    border-left: 3px solid var(--accent-green); /* Standardized border color */
}

/* Plugin Directory Layout */
.plugin-directory {
    display: flex;
    flex-direction: column; 
    gap: 12px;
}

.plugin-entry {
    display: grid;
    grid-template-columns: 220px 1fr; 
    align-items: center;
    gap: 20px;
    background: rgba(28, 25, 23, 0.4);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.plugin-entry:hover {
    background: rgba(132, 204, 22, 0.03);
    border-color: rgba(132, 204, 22, 0.4);
    transform: translateX(5px); 
    box-shadow: -5px 0 15px rgba(132, 204, 22, 0.1);
}

.plugin-entry .premium-link {
    margin-bottom: 0; 
    font-size: 12px;
    padding: 12px;
    background: #110f0e;
}

.plugin-entry p {
    font-size: 16px; 
    color: var(--text); 
    line-height: 1.5;
    font-weight: 500;
}

/* High-Density Plugin List */
.compact-plugin-list {
    list-style: none;
    margin-top: 10px;
}

.compact-plugin-list li {
    font-family: var(--font-primary);
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 10px;
    line-height: 1.4;
    padding-left: 15px;
    position: relative;
}

/* Custom bullet point */
.compact-plugin-list li::before {
    content: "■";
    color: var(--accent-orange);
    font-size: 10px;
    position: absolute;
    left: 0;
    top: 3px;
}

.compact-plugin-list a {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    border-bottom: 1px dashed var(--border);
    transition: all 0.2s;
}

.compact-plugin-list a:hover {
    color: var(--accent-green);
    border-bottom-color: var(--accent-green);
}

.plugin-entry strong { color: var(--accent-green); font-weight: 800; }

.link-grid-modern { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; }

.premium-link {
    display: block; 
    background: #1c1917; 
    border: 1px solid var(--border);
    padding: 15px; 
    border-radius: 8px; 
    color: var(--text);
    text-decoration: none; 
    font-weight: 700; 
    font-size: 13px; 
    text-transform: uppercase;
    transition: all 0.2s; 
    text-align: center; 
    font-family: var(--font-primary);
}

.premium-link:hover { 
    border-color: var(--accent-green); 
    background: rgba(132, 204, 22, 0.05); 
    color: var(--accent-green); 
}

/* Ironman FAQ specific */
.ironman-faq .premium-link {
    background: #110f0e;
    border: 1px solid var(--border);
    font-size: 12px;
}

/* Step-by-Step Instructions */
.import-steps {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 20px;
}

.step { display: flex; gap: 20px; align-items: flex-start; }

.step-num {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 900;
    color: var(--accent-orange);
    background: rgba(249, 115, 22, 0.1);
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid rgba(249, 115, 22, 0.2);
    min-width: 40px;
    text-align: center;
}

.step-content p { margin-bottom: 4px; }

/* Lists & Tables */
.intel-list { list-style: none; margin-top: 10px; }

.intel-list li {
    font-family: var(--font-primary);
    font-size: 16px;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.6;
}

.val {
    font-family: var(--font-mono);
    color: var(--accent-green);
    font-weight: 800;
}

.food-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.food-row {
    background: #110f0e;
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    font-size: 15px;
    transition: background 0.2s;
}

.food-row:hover { background: #1c1917; }
.food-row span { font-family: var(--font-primary); color: var(--text-dim); }
.food-row .val { font-size: 14px; }

/* Code Blocks */
pre {
    border-left: 4px solid var(--accent-green);
    background: #000;
    padding: 20px;
    font-size: 13px;
    margin: 15px 0 30px 0;
    border-radius: 6px; 
    overflow-x: auto; 
    color: var(--accent-green); 
    font-family: var(--font-mono); 
    border: 1px solid var(--border); 
}

/* =========================================
   LINK & BUTTON OVERRIDES
========================================= */

/* Global Link Reset (Kills the ugly blue/purple everywhere) */
a {
    color: var(--accent-green);
    text-decoration: none;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

a:hover {
    color: var(--text);
    text-shadow: 0 0 8px rgba(132, 204, 22, 0.4);
}

/* ==========================================
   MEDIA QUERIES
   ========================================== */
@media (max-width: 768px) {
    .showcase-logo { height: 45vh; }
    .hero-titles h1 { font-size: 2.5rem; }
    .content-header { flex-direction: column; gap: 15px; padding: 15px; }
    .premium-nav { flex-direction: column; width: 100%; padding: 0 20px; }
}

@media (max-width: 650px) {
    .input-row { grid-template-columns: 1fr; gap: 16px; }
    .chart-wrapper { height: 350px; padding: 10px; }
    #stat-chance { font-size: 2.5rem; }
    .card { padding: 20px; }
    .container { padding: 20px 10px; }

    /* Force font overrides for small screens where specific styles might break */
    .stat-item, .stat-item span, #res-name, .prob-label { font-family: var(--font-primary) !important; }
    .stat-item b, #target-kc, .kc-btn, #stat-chance { font-family: var(--font-mono) !important; }
}