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

:root {
    --bg-dark: #090d16;
    --card-bg: rgba(17, 25, 40, 0.75);
    --card-border: rgba(255, 255, 255, 0.07);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glow-color: rgba(99, 102, 241, 0.2);
    
    /* Rarity Colors */
    --rarity-common: #94a3b8;
    --rarity-rare: #3b82f6;
    --rarity-epic: #a855f7;
    --rarity-legendary: #f59e0b;
    
    /* Semantic Colors */
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-primary: #6366f1;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Ambient background glow */
.glass-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.12) 0%, transparent 40%),
                radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 1) 0%, rgba(9, 13, 22, 1) 100%);
    z-index: -1;
    position: fixed;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

/* ==========================================================================
   COMMON GLASS CARD COMPONENT
   ========================================================================== */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border var(--transition-fast);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

/* ==========================================================================
   HEADER SECTION
   ========================================================================== */
.main-header {
    text-align: center;
    margin-bottom: 3rem;
}

.main-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 30%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 20px var(--glow-color);
}

.main-header .subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   GLOBAL STATE WIDGET
   ========================================================================== */
.global-state-section {
    margin-bottom: 2.5rem;
}

.global-state-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.biome-card, .weather-card {
    border-radius: 12px;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.badge-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.biome-title, .weather-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.biome-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 300;
}

.weather-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.weather-icon {
    font-size: 2.25rem;
    animation: float 4s ease-in-out infinite;
}

.weather-modifier-tip {
    font-size: 0.825rem;
    font-weight: 500;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.06);
}

/* Weather-specific style tints */
.weather-sunny {
    box-shadow: inset 0 0 20px rgba(234, 179, 8, 0.04);
    border-color: rgba(234, 179, 8, 0.15);
}
.weather-sunny .weather-modifier-tip { color: #fef08a; }

.weather-cloudy {
    box-shadow: inset 0 0 20px rgba(148, 163, 184, 0.04);
    border-color: rgba(148, 163, 184, 0.15);
}
.weather-cloudy .weather-modifier-tip { color: #cbd5e1; }

.weather-rainy {
    box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.2);
}
.weather-rainy .weather-modifier-tip { color: #93c5fd; }

.weather-stormy {
    box-shadow: inset 0 0 20px rgba(168, 85, 247, 0.06);
    border-color: rgba(168, 85, 247, 0.25);
    animation: pulse-border 3s infinite;
}
.weather-stormy .weather-modifier-tip { color: #f5d0fe; }

/* Active Fish List */
.active-fish-pool h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.fish-pill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.fish-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    font-weight: 500;
    transition: transform var(--transition-fast), background var(--transition-fast);
    cursor: default;
}

.fish-pill:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.06);
}

.fish-rarity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Rarity-specific styling rules */
.rarity-common .fish-rarity-dot { background-color: var(--rarity-common); }
.rarity-common { border-color: rgba(148, 163, 184, 0.25); }

.rarity-rare .fish-rarity-dot { background-color: var(--rarity-rare); }
.rarity-rare { border-color: rgba(59, 130, 246, 0.25); }

.rarity-epic .fish-rarity-dot { background-color: var(--rarity-epic); }
.rarity-epic { border-color: rgba(168, 85, 247, 0.25); }

.rarity-legendary .fish-rarity-dot { background-color: var(--rarity-legendary); }
.rarity-legendary { 
    border-color: rgba(245, 158, 11, 0.35); 
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.1);
}

/* ==========================================================================
   GRID CONTENT LAYOUT
   ========================================================================== */
.content-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
    align-items: start;
}

.section-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-weight: 300;
}

/* ==========================================================================
   LEFT COLUMN - SEARCH & STATS LOOKUP
   ========================================================================== */
.search-form {
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-box input {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-box input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.btn-search {
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.btn-search:hover {
    opacity: 0.9;
}

.btn-search:active {
    transform: scale(0.98);
}

.clear-search {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.clear-search:hover {
    color: var(--text-main);
}

/* Player profile card UI */
.player-profile-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.profile-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
}

.profile-user {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    color: #fff;
    font-weight: 700;
}

.stats-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
    text-align: center;
}

.stat-val {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-primary { color: var(--color-primary); }

/* Inventory Grid */
.inventory-section h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.inventory-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.inventory-card {
    border-radius: 8px;
    padding: 0.85rem;
    background: rgba(15, 23, 42, 0.2);
    border-left: 4px solid var(--rarity-common);
    transition: transform var(--transition-fast);
}

.inventory-card:hover {
    transform: scale(1.02);
}

.inventory-card.rarity-common { border-left-color: var(--rarity-common); }
.inventory-card.rarity-rare { border-left-color: var(--rarity-rare); }
.inventory-card.rarity-epic { border-left-color: var(--rarity-epic); }
.inventory-card.rarity-legendary { border-left-color: var(--rarity-legendary); }

.inv-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.rarity-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
}

.inventory-card.rarity-common .rarity-badge { color: var(--rarity-common); }
.inventory-card.rarity-rare .rarity-badge { color: var(--rarity-rare); }
.inventory-card.rarity-epic .rarity-badge { color: var(--rarity-epic); }
.inventory-card.rarity-legendary .rarity-badge { color: var(--rarity-legendary); }

.inv-qty {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.inv-fish-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inv-record {
    display: block;
    font-size: 0.725rem;
    color: var(--text-muted);
}

.empty-inventory {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 1.5rem;
}

/* Errors & Not Found */
.not-found-card {
    background: rgba(239, 68, 68, 0.03);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.error-msg {
    color: #fca5a5;
    font-size: 0.925rem;
    margin-bottom: 0.25rem;
}

.error-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ==========================================================================
   RIGHT COLUMN - LEADERBOARDS
   ========================================================================== */
.table-container {
    overflow-x: auto;
    width: 100%;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.leaderboard-table th, .leaderboard-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.leaderboard-table th {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding-bottom: 0.75rem;
}

.leaderboard-table tbody tr {
    transition: background-color var(--transition-fast);
}

.leaderboard-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.015);
}

.col-rank {
    width: 60px;
    font-size: 1rem;
    text-align: center;
}

.col-user {
    font-weight: 600;
}

.leader-link {
    color: var(--text-main);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.leader-link:hover {
    color: var(--color-primary);
}

.font-bold {
    font-weight: 700;
}

.col-catches {
    color: #fff;
}

.highlighted-row {
    background-color: rgba(99, 102, 241, 0.08) !important;
}

.empty-table {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 2rem !important;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.main-footer {
    text-align: center;
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.825rem;
    color: var(--text-muted);
}

.footer-links {
    margin-top: 0.25rem;
    font-size: 0.775rem;
}

.footer-links code {
    color: var(--color-primary);
}

/* ==========================================================================
   ANIMATIONS & EFFECTS
   ========================================================================== */
.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-slide-up {
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-shake {
    animation: shake 0.4s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes pulse-border {
    0%, 100% { border-color: rgba(168, 85, 247, 0.25); }
    50% { border-color: rgba(168, 85, 247, 0.5); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* ==========================================================================
   RESPONSIVENESS (MOBILE)
   ========================================================================== */
@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .global-state-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .main-header h1 {
        font-size: 2.25rem;
    }
}
