/* ========================================
   Dragon Quest VII Monster Compendium
   HyperTurtle.tech - In-Game Menu Theme
   Inspired by DQ7 Reimagined's UI aesthetic
   ======================================== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* CSS Variables */
:root {
    /* DQ Teal/Cyan - HP Bar style */
    --dq-teal: #2dd4bf;
    --dq-teal-dark: #14b8a6;
    --dq-blue: #0ea5e9;
    --dq-blue-light: #38bdf8;
    --dq-blue-dark: #0284c7;
    --dq-blue-glow: rgba(14, 165, 233, 0.3);
    
    /* Slime Colors */
    --slime-blue: #4fc3f7;
    --slime-blue-glow: rgba(79, 195, 247, 0.3);
    
    /* DQ Gold - Warm accents */
    --gold: #f59e0b;
    --gold-light: #fbbf24;
    --gold-dark: #d97706;
    --gold-glow: rgba(245, 158, 11, 0.3);
    
    /* Magic Purple */
    --magic-purple: #8b5cf6;
    --magic-purple-glow: rgba(139, 92, 246, 0.3);
    
    /* Heal Green - MP Bar style */
    --heal-green: #22c55e;
    --heal-green-light: #4ade80;
    --heal-green-glow: rgba(34, 197, 94, 0.3);
    
    /* Fire/Damage Red */
    --fire-red: #ef4444;
    --fire-glow: rgba(239, 68, 68, 0.3);
    
    /* Background - Warm adventure tones */
    --bg-darkest: #1e293b;      /* Deep blue-gray for contrast areas */
    --bg-dark: #334155;         /* Slate for header/footer */
    --bg-gradient-start: #3b5998; /* Adventure sky blue */
    --bg-gradient-end: #1e3a5f;   /* Deep ocean */
    
    /* Card/Panel - Dark with transparency to show background */
    --bg-card: rgba(12, 18, 30, 0.9);        /* Darker blue-gray */
    --bg-card-hover: rgba(20, 30, 50, 0.95); /* Slightly lighter on hover */
    --bg-surface: rgba(25, 35, 55, 0.8);     /* For inner elements */
    --bg-panel: rgba(9, 14, 28, 0.95);       /* Controls panel */
    
    /* Text - Light for dark cards */
    --text-primary: #f0f4f8;     /* Off-white */
    --text-secondary: #cbd5e1;   /* Light gray */
    --text-muted: #94a3b8;       /* Muted gray */
    --text-dim: #64748b;         /* Dim gray */
    --text-light: #f8fafc;       /* Bright white */
    
    /* Utility */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.25s ease;
    --transition-bounce: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Shadows - Softer for light theme */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    --shadow-panel: 0 4px 20px rgba(0, 0, 0, 0.12);
    --glow-blue: 0 0 20px var(--dq-blue-glow);
    --glow-gold: 0 0 20px var(--gold-glow);
    --glow-teal: 0 0 15px rgba(45, 212, 191, 0.4);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 18px; /* Increased base font size */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 500;
    background: #090c14;
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
}

/* ========================================
   Footer Fairy
   ======================================== */

.footer-fairy {
    margin-bottom: 1rem;
}

.footer-fairy-img {
    width: 50px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.4));
    animation: footer-fairy-bob 3s ease-in-out infinite;
}

@keyframes footer-fairy-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ========================================
   Slime Burst Easter Egg
   ======================================== */

.site-header {
    cursor: pointer;
}

@keyframes slime-fall {
    0% { 
        transform: translateY(-20px); 
        opacity: 0; 
    }
    15% { 
        opacity: 1; 
    }
    100% { 
        transform: translateY(100vh); 
        opacity: 0; 
    }
}

/* Header shake animation */
@keyframes header-shake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-4px) rotate(-0.5deg); }
    20% { transform: translateX(4px) rotate(0.5deg); }
    30% { transform: translateX(-3px) rotate(-0.3deg); }
    40% { transform: translateX(3px) rotate(0.3deg); }
    50% { transform: translateX(-2px) rotate(-0.2deg); }
    60% { transform: translateX(2px) rotate(0.2deg); }
    70% { transform: translateX(-1px); }
    80% { transform: translateX(1px); }
    90% { transform: translateX(-1px); }
}

.site-header.shaking {
    animation: header-shake 0.5s ease-in-out;
}

/* ========================================
   Typography
   ======================================== */

h1, h2, h3, .monster-name {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1.2;
}

/* ========================================
   Header - Compact & Clean
   ======================================== */

.site-header {
    position: relative;
    z-index: 10;
    padding: 1rem 1.5rem;
    text-align: center;
    background: rgba(9, 12, 20, 0.98);
    backdrop-filter: blur(8px);
    border-bottom: 2px solid var(--dq-teal);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.site-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--dq-teal), transparent);
    opacity: 0.6;
}

.main-title {
    font-size: 1.4rem;
    margin: 0;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* "Dragon Quest" - Blue metallic gradient like the logo */
.title-main {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(
        180deg,
        #7dd3fc 0%,      /* Light sky blue */
        #0ea5e9 25%,     /* Bright blue */
        #0284c7 50%,     /* Deep blue */
        #0369a1 75%,     /* Darker blue */
        #075985 100%     /* Navy accent */
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: none;
    filter: drop-shadow(0 2px 4px rgba(14, 165, 233, 0.4));
}

/* "VII" - Gold ornate like the logo */
.title-numeral {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.8rem;
    background: linear-gradient(
        180deg,
        #fef3c7 0%,      /* Light cream */
        #fcd34d 20%,     /* Bright gold */
        #f59e0b 40%,     /* Orange gold */
        #d97706 60%,     /* Deep gold */
        #b45309 80%,     /* Bronze */
        #92400e 100%     /* Dark bronze */
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 4px;
    filter: drop-shadow(0 2px 6px rgba(251, 191, 36, 0.5));
}

/* "Monster Compendium" - Flowing subtitle like "Reimagined" */
.title-subtitle {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 600;
    font-style: italic;
    margin: 0.25rem 0 0 0;
    background: linear-gradient(
        90deg,
        #fbbf24 0%,
        #f59e0b 30%,
        #ea580c 60%,
        #dc2626 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* ========================================
   Main Content
   ======================================== */

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* ========================================
   Controls - Compact Single Row
   ======================================== */

.controls-container {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.controls-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

#search-input {
    flex: 1;
    min-width: 150px;
    padding: 0.6rem 0.85rem;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition);
}

#search-input::placeholder {
    color: var(--text-dim);
}

#search-input:focus {
    border-color: var(--dq-teal);
    box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.25);
}

#family-filter,
#sort-select {
    padding: 0.6rem 2rem 0.6rem 0.85rem;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    cursor: pointer;
    outline: none;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%232dd4bf' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

#family-filter:hover,
#sort-select:hover {
    border-color: var(--dq-teal);
}

#family-filter:focus,
#sort-select:focus {
    border-color: var(--dq-teal);
    box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.3);
}

/* Dropdown options - ensure readability */
#family-filter option,
#sort-select option {
    background: #1e293b;
    color: #f0f4f8;
    padding: 0.5rem;
}

.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.25rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.view-btn {
    padding: 0.35rem 0.6rem;
    font-size: 1rem;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.view-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.view-btn.active {
    background: var(--dq-teal);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ========================================
   Monster Grid - List View (Default) & Grid View
   ======================================== */

.monster-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.monster-grid.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* ========================================
   Monster Card - List View (Default)
   ======================================== */

.monster-card {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    cursor: pointer;
    opacity: 0;
    animation: card-appear 0.3s ease forwards;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

@keyframes card-appear {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.monster-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--dq-teal);
    box-shadow: 
        0 0 20px rgba(45, 212, 191, 0.3),
        0 8px 24px rgba(0, 0, 0, 0.3);
}

.monster-card.expanded {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem;
    border-color: var(--dq-teal);
    border-width: 2px;
    background: rgba(9, 14, 28, 0.95);
    box-shadow: 
        0 0 25px rgba(45, 212, 191, 0.2),
        0 12px 32px rgba(0, 0, 0, 0.4);
}

/* Card Header - List View */
.card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

/* Name first, takes available space */
.monster-name {
    flex: 1;
    min-width: 0;
}

/* Meta info (family + number) pushed right */
.card-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.monster-number {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    display: none; /* Hidden in list view */
}

/* Show number only in grid view */
.grid-view .monster-number {
    display: inline-block;
}

.family-badge {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Family badge colors - Solid for light theme */
.family-slime { background: #0ea5e9; color: white; }
.family-dragon { background: #ef4444; color: white; }
.family-beast { background: #f97316; color: white; }
.family-bird { background: #a855f7; color: white; }
.family-material { background: #64748b; color: white; }
.family-undead { background: #7c3aed; color: white; }
.family-demon { background: #dc2626; color: white; }
.family-humanoid { background: #d97706; color: white; }
.family-nature { background: #16a34a; color: white; }
.family-aquatic { background: #0891b2; color: white; }
.family-bug { background: #65a30d; color: white; }
.family-elemental { background: #eab308; color: white; }
.family-machine { background: #475569; color: white; }
.family-metal { 
    background: linear-gradient(135deg, #94a3b8, #64748b); 
    color: white; 
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Monster Image - Hidden in list view, shown in grid view */
.monster-image-container {
    display: none;
}

.grid-view .monster-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem;
    background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    border-radius: var(--radius-md);
    min-height: 100px;
}

.monster-image {
    max-width: 100px;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
    transition: var(--transition);
}

@keyframes monster-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.grid-view .monster-image {
    animation: monster-float 3s ease-in-out infinite;
}

.grid-view .monster-card:hover {
    border-color: var(--dq-teal);
    box-shadow: 
        0 0 25px rgba(45, 212, 191, 0.3),
        0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Only apply transform on devices with hover capability */
@media (hover: hover) {
    .grid-view .monster-card:hover {
        transform: translateY(-3px);
    }
}

/* Only apply image hover effects on devices with hover capability */
@media (hover: hover) {
    .grid-view .monster-card:hover .monster-image {
        transform: scale(1.1);
        animation-play-state: paused;
    }
}

.monster-image-placeholder {
    font-size: 2.5rem;
    opacity: 0.5;
}

/* Monster Name */
.card-header .monster-name {
    font-size: 1.15rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-view .monster-name {
    font-size: 1.25rem;
    text-align: center;
    margin: 0.5rem 0;
    white-space: normal;
    flex: none;
}

/* Expand Arrow - List view indicator */
.expand-arrow {
    color: var(--text-muted);
    font-size: 0.7rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.monster-card.expanded .expand-arrow {
    transform: rotate(180deg);
    color: var(--gold);
}

.grid-view .expand-arrow {
    display: none;
}

/* Quick Stats - Hidden in list view, shown in grid view */
.quick-stats {
    display: none;
}

.grid-view .quick-stats {
    display: flex;
    gap: 0.5rem;
    margin: 0.5rem 0;
    justify-content: center;
}

/* Hide quick stats when expanded (redundant with detailed stats) */
.monster-card.expanded .quick-stats {
    display: none;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-surface);
}

.grid-view .stat-item {
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.1rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--slime-blue);
    font-family: 'Cinzel', serif;
}

.grid-view .stat-value {
    font-size: 1.15rem;
}

/* Grid Stats - Only visible in grid view */
.grid-stats {
    display: none;
}

.grid-view .grid-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.grid-hp {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--fire-red);
}

.grid-weak {
    color: #fca5a5;
    font-size: 0.85rem;
}

.grid-resist {
    color: #86efac;
    font-size: 0.85rem;
}

.grid-none {
    opacity: 0.5;
}

/* Expand Button - Hidden (cards are clickable) */
.expand-btn {
    display: none;
}

/* ========================================
   Expanded Card Content - Compact Modal
   ======================================== */

.expanded-content {
    display: none;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--bg-surface);
    animation: content-reveal 0.3s ease;
    overflow-anchor: none; /* Prevent scroll jump on expand */
}

@keyframes content-reveal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.monster-card.expanded .expanded-content {
    display: block;
}

/* Stats Grid - Compact */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.stat-box {
    background: var(--bg-dark);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid var(--bg-surface);
}

.stat-box .stat-label {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.75rem;
}

.stat-box .stat-value {
    font-size: 1.15rem;
}

.section-title {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Info Lists - Compact */
.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    padding: 0.5rem 0.75rem;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
    border-left: 2px solid var(--dq-blue);
    font-size: 1rem;
}

/* Resistance Grid - Compact */
.resistance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.resistance-item {
    background: var(--bg-dark);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.9rem;
    border: 1px solid var(--bg-surface);
}

.resistance-item strong {
    display: block;
    color: var(--slime-blue);
    margin-bottom: 0.15rem;
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* Drop Items - Compact */
.drop-item {
    background: var(--bg-dark);
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.35rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--bg-surface);
    font-size: 1rem;
}

.drop-rate {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gold);
    background: rgba(251, 191, 36, 0.15);
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-sm);
}

/* ========================================
   Combat Tab - New Layout
   ======================================== */

.combat-basics {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.combat-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.combat-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.combat-value {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Cinzel', serif;
}

/* In-game UI style: teal HP, green MP */
.hp-val { color: var(--dq-teal-dark); }
.mp-val { color: var(--heal-green); }
.atk-val { color: var(--gold-dark); }

.combat-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--bg-surface);
}

.combat-row:last-of-type {
    border-bottom: none;
}

.row-label {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    min-width: 85px;
}

.row-label.weak-label { color: #f87171; }
.row-label.resist-label { color: #4ade80; }

.combat-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.combat-tag {
    font-size: 1rem;
    padding: 0.3rem 0.55rem;
    border-radius: var(--radius-sm);
}

.combat-tag.weak-tag {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.combat-tag.resist-tag {
    background: rgba(74, 222, 128, 0.12);
    color: #86efac;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.combat-tag strong {
    margin-left: 0.25rem;
}

.combat-none {
    color: var(--text-muted);
    font-size: 1rem;
    font-style: italic;
}

.combat-abilities {
    font-size: 1.05rem;
    color: var(--text-secondary);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--bg-surface);
}

.combat-abilities:last-child {
    border-bottom: none;
}

.ability-label {
    color: var(--gold-light);
    font-weight: 600;
}

/* Monster Description - Compact */
.monster-desc {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem;
    margin: 0.5rem 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.monster-desc .desc-monster-image {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    aspect-ratio: 1;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(59, 130, 246, 0.3));
}

.monster-desc p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* More Details Button */
.more-details-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem;
    margin-top: 0.5rem;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--dq-teal);
    border-radius: var(--radius-sm);
    color: var(--dq-teal);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.more-details-btn:hover {
    background: rgba(25, 40, 60, 0.95);
    border-color: var(--gold);
    color: var(--gold);
}

.more-details-btn .details-arrow {
    transition: transform 0.25s ease;
}

.more-details-btn.open .details-arrow {
    transform: rotate(180deg);
}

/* More Details Section */
.more-details {
    display: none;
    padding-top: 0.5rem;
    animation: slideDown 0.25s ease;
}

.more-details.open {
    display: block;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.detail-section {
    margin-bottom: 0.75rem;
}

.detail-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gold-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}

.detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.detail-stats span {
    font-size: 0.95rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.25);
    padding: 0.3rem 0.55rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-stats strong {
    color: var(--text-primary);
    margin-left: 0.25rem;
}

.detail-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.detail-chip {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--dq-teal);
}

.detail-drops {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.detail-drop {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.35rem 0.55rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-drop .drop-rate {
    font-weight: 700;
    color: #1e293b;
    background: var(--gold-light);
    padding: 0.2rem 0.45rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

/* Bestiary Number - Bottom of More Details */
.bestiary-number {
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.6rem;
    margin-top: 0.5rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.wiki-link {
    display: block;
    text-align: center;
    font-size: 0.9rem;
    color: var(--dq-teal);
    padding: 0.6rem;
    margin-top: 0.5rem;
    text-decoration: none;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--transition);
}

.wiki-link:hover {
    background: var(--dq-teal);
    color: white;
}

/* ========================================
   Footer
   ======================================== */

.site-footer {
    background: linear-gradient(180deg, rgba(9, 12, 20, 0.95) 0%, rgba(5, 8, 15, 0.98) 100%);
    backdrop-filter: blur(8px);
    border-top: 2px solid var(--dq-teal);
    color: var(--text-light);
    text-align: center;
    padding: 2rem 1.5rem;
    margin-top: 3rem;
    position: relative;
    z-index: 10;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* Brand Section */
.footer-brand {
    margin: 1rem 0 1.5rem;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.15) 0%, rgba(251, 191, 36, 0.1) 100%);
    border: 1px solid rgba(45, 212, 191, 0.3);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: var(--transition);
}

.brand-link:hover {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.25) 0%, rgba(251, 191, 36, 0.2) 100%);
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(45, 212, 191, 0.2);
}

.brand-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.brand-name {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--dq-teal) 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

/* Footer Links */
.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--dq-teal);
}

.footer-divider {
    color: var(--text-dim);
    font-size: 0.8rem;
}

/* Disclaimer */
.disclaimer {
    font-size: 0.8rem;
    color: rgba(248, 250, 252, 0.4);
    margin-top: 0.5rem;
    line-height: 1.6;
}

/* ========================================
   Grid View Specific Styles
   ======================================== */

.grid-view .monster-card {
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    /* Add specific transition for transform to avoid layout issues */
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.grid-view .card-header {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 0.35rem;
}

.grid-view .card-header .monster-name {
    order: 2;
    text-align: center;
    white-space: normal;
}

.grid-view .card-header .card-meta {
    order: 1;
    justify-content: center;
}

.grid-view .card-header .expand-arrow {
    display: none;
}

/* Grid view uses modal instead of inline expansion */
.grid-view .monster-card.expanded {
    /* No visual change in grid - modal handles details */
}

.grid-view .expanded-content {
    display: none !important;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .title-main { font-size: 1.2rem; }
    .title-numeral { font-size: 1.4rem; }
    .title-subtitle { font-size: 0.75rem; letter-spacing: 2px; }
    
    .controls-row {
        gap: 0.4rem;
    }
    
    #search-input {
        min-width: 100px;
    }
    
    .grid-view {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 480px) {
    html {
        font-size: 17px; /* Slightly smaller base on mobile but still readable */
    }
    
    .main-content { padding: 0.5rem; }
    .controls-container { padding: 0.5rem 0.75rem; }
    .site-header { padding: 0.5rem 1rem; }
    
    .controls-row {
        flex-wrap: wrap;
    }
    
    #search-input {
        flex: 1 1 100%;
        order: -1;
        font-size: 1rem;
        margin-bottom: 0.4rem;
    }
    
    #family-filter,
    #sort-select {
        flex: 1;
        min-width: 0;
        font-size: 0.85rem;
        padding: 0.5rem 1.5rem 0.5rem 0.5rem;
    }
    
    .view-toggle {
        flex-shrink: 0;
    }
    
    .monster-card {
        padding: 0.6rem 0.85rem;
        gap: 0.5rem;
    }
    
    .card-header .monster-name {
        font-size: 1.05rem;
    }
    
    .card-meta {
        gap: 0.35rem;
    }
    
    .family-badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.45rem;
    }
    
    .monster-number {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* Combat Section - Mobile */
    .combat-basics {
        gap: 0.4rem;
    }
    
    .combat-stat {
        padding: 0.35rem 0.45rem;
    }
    
    .combat-label {
        font-size: 0.7rem;
    }
    
    .combat-value {
        font-size: 1.2rem;
    }
    
    .combat-row {
        padding: 0.35rem 0;
    }
    
    .row-label {
        font-size: 0.85rem;
        min-width: 75px;
    }
    
    .combat-tag {
        font-size: 0.9rem;
        padding: 0.25rem 0.45rem;
    }
    
    .combat-abilities {
        font-size: 0.95rem;
    }
    
    /* Monster Description - Mobile */
    .monster-desc {
        gap: 0.6rem;
        padding: 0.5rem;
    }
    
    .monster-desc .desc-monster-image {
        width: 50px;
        height: 50px;
    }
    
    .monster-desc p {
        font-size: 0.9rem;
    }
    
    /* More Details - Mobile */
    .more-details-btn {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    
    .detail-title {
        font-size: 0.85rem;
    }
    
    .detail-stats span {
        font-size: 0.9rem;
    }
    
    .detail-chip {
        font-size: 0.85rem;
    }
    
    .detail-drop {
        font-size: 0.9rem;
    }
    
    /* Expanded content - Tighter spacing */
    .expanded-content {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }
    
    /* Stats Grid - Tighter */
    .stats-grid {
        gap: 0.4rem;
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stat-box {
        padding: 0.45rem;
    }
    
    .stat-box .stat-label {
        font-size: 0.65rem;
    }
    
    .stat-box .stat-value {
        font-size: 1.05rem;
    }
}

/* ========================================
   Accessibility
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html { scroll-behavior: auto; }
    .footer-fairy-img { animation: none; }
}

/* Focus states */
button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* ========================================
   Monster Modal (Grid View)
   ======================================== */

.monster-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.monster-modal.open {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    background: rgba(9, 14, 28, 0.98);
    backdrop-filter: blur(12px);
    border: 2px solid var(--dq-teal);
    border-radius: var(--radius-lg);
    box-shadow: 
        0 0 40px rgba(45, 212, 191, 0.25),
        0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    background: var(--bg-surface);
    border: 1px solid var(--bg-hover);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: var(--fire-red);
    border-color: var(--fire-red);
    color: white;
}

#modal-body {
    padding: 1rem;
}

/* Modal Header */
.modal-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-right: 2rem;
}

.modal-header .monster-number {
    font-size: 0.95rem;
}

.modal-header .family-badge {
    font-size: 0.85rem;
}

.modal-header .monster-name {
    font-size: 1.4rem;
    margin: 0;
}

/* Modal Monster Display */
.modal-monster-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-monster-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(59, 130, 246, 0.4));
}

.modal-monster-info {
    flex: 1;
}

.modal-monster-info p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Modal Details Section */
.modal-details {
    margin-top: 0.5rem;
}

/* Modal responsive */
@media (max-width: 480px) {
    .monster-modal.open {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 1rem;
        padding-top: env(safe-area-inset-top, 1rem);
        animation: none;
    }
    
    .modal-backdrop {
        position: fixed;
        inset: 0;
        z-index: -1;
    }
    
    .modal-content {
        position: relative;
        width: 100%;
        max-width: none;
        max-height: calc(100% - 2rem);
        margin: 0;
        animation: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #modal-body {
        padding: 0.85rem;
    }
    
    .modal-header .monster-name {
        font-size: 1.2rem;
    }
    
    .modal-header .monster-number {
        font-size: 0.85rem;
    }
    
    .modal-header .family-badge {
        font-size: 0.75rem;
    }
    
    .modal-monster-display {
        flex-direction: column;
        text-align: center;
    }
    
    .modal-monster-image {
        width: 80px;
        height: 80px;
    }
    
    .modal-monster-info p {
        font-size: 0.9rem;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .expand-btn,
    .view-toggle,
    .footer-fairy {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .monster-card {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #ccc;
    }
}
