/* ==========================================================================
   Base Design System & Themes
   ========================================================================== */

:root {
    /* Fonts */
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Functional Colors (Static) */
    --color-emerald: #10b981;
    --color-emerald-rgb: 16, 185, 129;
    --color-gold: #f59e0b;
    --color-gold-rgb: 245, 158, 11;
    --color-blue: #3b82f6;
    --color-blue-rgb: 59, 130, 246;
    --color-indigo: #6366f1;
    --color-indigo-rgb: 99, 102, 241;
    --color-sky: #0ea5e9;
    --color-sky-rgb: 14, 165, 233;
    
    /* Light Theme Tokens */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-color-hover: rgba(0, 0, 0, 0.15);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    --shadow-premium: 0 20px 40px -15px rgba(15, 23, 42, 0.06);
    
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.06);
    
    --scrollbar-thumb: #cbd5e1;
    --scrollbar-track: #f1f5f9;
    
    --card-hover-bg: #fafafa;
}

[data-theme="dark"] {
    /* Dark Theme Tokens */
    --bg-primary: #070a13;
    --bg-secondary: #0c101f;
    --bg-tertiary: #161c30;
    --bg-card: #0f1527;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-hover: rgba(255, 255, 255, 0.12);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.4);
    --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    
    --glass-bg: rgba(12, 16, 31, 0.8);
    --glass-border: rgba(255, 255, 255, 0.05);
    
    --scrollbar-thumb: #1e293b;
    --scrollbar-track: #0c101f;
    
    --card-hover-bg: #12192e;
}

/* ==========================================================================
   Reset & Global Styles
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Top Accent Progress Bar */
.top-accent-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--color-sky) 0%, var(--color-emerald) 50%, var(--color-indigo) 100%);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.app-header {
    background-color: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 4px;
    z-index: 999;
    transition: background-color 0.3s, border-color 0.3s;
}

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

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(var(--color-sky-rgb), 0.15) 0%, rgba(var(--color-emerald-rgb), 0.15) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-emerald);
    border: 1px solid rgba(var(--color-emerald-rgb), 0.2);
}

.logo-icon i {
    width: 20px;
    height: 20px;
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo-text h1 span {
    background: linear-gradient(90deg, var(--color-emerald), var(--color-sky));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text p {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 2px;
    letter-spacing: 0.2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Badges for external links */
.exchange-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.exchange-link i {
    width: 14px;
    height: 14px;
}

.bmv-badge {
    background-color: rgba(var(--color-sky-rgb), 0.1);
    color: var(--color-sky);
    border: 1px solid rgba(var(--color-sky-rgb), 0.2);
}

.bmv-badge:hover {
    background-color: var(--color-sky);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(var(--color-sky-rgb), 0.25);
}

.biva-badge {
    background-color: rgba(var(--color-indigo-rgb), 0.1);
    color: var(--color-indigo);
    border: 1px solid rgba(var(--color-indigo-rgb), 0.2);
}

.biva-badge:hover {
    background-color: var(--color-indigo);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(var(--color-indigo-rgb), 0.25);
}

/* Theme Toggle Button */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    border-color: var(--border-color-hover);
    transform: scale(1.03);
    background-color: var(--bg-tertiary);
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
.sun-icon { display: none; color: var(--color-gold); }
.moon-icon { display: block; color: var(--text-secondary); }

/* ==========================================================================
   Main Grid Layout & Sidebar
   ========================================================================== */

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

/* Stats Dashboard Panel */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-color-hover);
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-wrapper i {
    width: 22px;
    height: 22px;
}

.stat-icon-wrapper.blue {
    background-color: rgba(var(--color-blue-rgb), 0.1);
    color: var(--color-blue);
}

.stat-icon-wrapper.green {
    background-color: rgba(var(--color-emerald-rgb), 0.1);
    color: var(--color-emerald);
}

.stat-icon-wrapper.gold {
    background-color: rgba(var(--color-gold-rgb), 0.1);
    color: var(--color-gold);
}

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

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin: 2px 0;
}

.stat-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Dashboard Columns */
.dashboard-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .sidebar-area {
        position: relative !important;
        top: 0 !important;
    }
}

/* Sidebar and Control Cards */
.sidebar-area {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: sticky;
    top: 85px;
}

.control-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.card-header i {
    width: 18px;
    height: 18px;
    color: var(--color-emerald);
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.2px;
}

/* Search Box Styles */
.search-box-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.search-box-wrapper input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 500;
    outline: none;
    transition: all 0.2s ease;
}

.search-box-wrapper input:focus {
    border-color: var(--color-emerald);
    background-color: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(var(--color-emerald-rgb), 0.12);
}

.clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.clear-search:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.clear-search i {
    width: 14px;
    height: 14px;
}

/* Filtering Form Elements */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select {
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 32px;
}

.filter-group select:focus {
    border-color: var(--color-emerald);
    background-color: var(--bg-secondary);
}

.filter-row {
    display: flex;
    gap: 0.75rem;
}

.flex-1 {
    flex: 1;
}

.btn-reset-filters {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px dashed var(--border-color);
    background: none;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.btn-reset-filters:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

.btn-reset-filters i {
    width: 15px;
    height: 15px;
}

/* ==========================================================================
   Calendar Element
   ========================================================================== */

.calendar-card {
    display: flex;
    flex-direction: column;
}

.calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.current-month-year {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: capitalize;
}

.nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color-hover);
}

.nav-btn i {
    width: 16px;
    height: 16px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.4rem;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 6px;
    column-gap: 6px;
    margin-bottom: 1rem;
}

.calendar-day-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    user-select: none;
}

/* Day cell variants */
.calendar-day-cell:hover:not(.empty-day) {
    background-color: var(--bg-tertiary);
}

.calendar-day-cell.empty-day {
    cursor: default;
    opacity: 0.25;
}

.calendar-day-cell.today {
    border: 2px solid var(--text-primary);
    font-weight: 700;
}

.calendar-day-cell.active-selected {
    background-color: var(--text-primary) !important;
    color: var(--bg-primary) !important;
    font-weight: 700;
}

/* Event Dot Container */
.day-event-dots {
    display: flex;
    justify-content: center;
    gap: 3px;
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
}

.event-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
}

.event-dot.ex-date {
    background-color: var(--color-gold);
}

.event-dot.pay-date {
    background-color: var(--color-emerald);
}

/* Styles for calendar cells when active is selected to keep dots visible */
.calendar-day-cell.active-selected .event-dot.ex-date {
    background-color: #ffffff;
}
.calendar-day-cell.active-selected .event-dot.pay-date {
    background-color: #ffffff;
}

/* Calendar Legend styling */
.calendar-legend {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.legend-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.ex-date-dot {
    background-color: var(--color-gold);
}

.legend-dot.pay-date-dot {
    background-color: var(--color-emerald);
}

.legend-dot.double-dot {
    background: linear-gradient(90deg, var(--color-gold) 50%, var(--color-emerald) 50%);
}

.btn-today {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-today:hover {
    border-color: var(--border-color-hover);
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

.btn-today i {
    width: 14px;
    height: 14px;
}

/* ==========================================================================
   Results Area & Dividend Cards
   ========================================================================== */

.results-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.results-title-info h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.results-count {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.active-filter-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(var(--color-emerald-rgb), 0.08);
    color: var(--color-emerald);
    border: 1px solid rgba(var(--color-emerald-rgb), 0.15);
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.active-filter-indicator button {
    background: none;
    border: none;
    color: var(--color-emerald);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 2px;
}

.active-filter-indicator button:hover {
    background-color: rgba(var(--color-emerald-rgb), 0.15);
}

.active-filter-indicator button i {
    width: 12px;
    height: 12px;
}

/* Cards Container */
.dividend-cards-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 768px) and (max-width: 1024px) {
    .dividend-cards-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

.dividend-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.dividend-card:hover {
    transform: translateY(-2px) scale(1.005);
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-md);
    background-color: var(--card-hover-bg);
}

/* Card details (Left side) */
.card-left-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.company-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.company-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.company-badge-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ticker-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.company-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Insignias / Badges */
.badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    text-transform: uppercase;
}

.badge.bmv-tag {
    background-color: rgba(var(--color-sky-rgb), 0.1);
    color: var(--color-sky);
}

.badge.biva-tag {
    background-color: rgba(var(--color-indigo-rgb), 0.1);
    color: var(--color-indigo);
}

.badge.badge-outline {
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-transform: none;
    font-weight: 500;
}

.badge.badge-success {
    background-color: rgba(var(--color-emerald-rgb), 0.1);
    color: var(--color-emerald);
}

.badge.badge-warning {
    background-color: rgba(var(--color-gold-rgb), 0.1);
    color: var(--color-gold);
}

/* Card Dates & Middle elements */
.card-center-section {
    display: flex;
    gap: 1.5rem;
    margin: 0 1.5rem;
}

.date-block {
    display: flex;
    flex-direction: column;
}

.date-block-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.date-block-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1px;
}

.date-block-value.ex-color {
    color: var(--color-gold);
}

.date-block-value.pay-color {
    color: var(--color-emerald);
}

/* Card Financials (Right side) */
.card-right-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 0.1rem;
    flex-shrink: 0;
}

.amount-label {
    font-size: 1.15rem;
    font-weight: 750;
    color: var(--color-emerald);
}

.yield-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.card-chevron {
    color: var(--text-muted);
    margin-left: 0.75rem;
    transition: transform 0.2s ease, color 0.2s;
    display: flex;
    align-items: center;
}

.dividend-card:hover .card-chevron {
    color: var(--text-primary);
    transform: translateX(2px);
}

.card-chevron i {
    width: 18px;
    height: 18px;
}

/* Collapse middle / right parts on small screens */
@media (max-width: 767px) {
    .dividend-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .card-left-section {
        width: 100%;
    }
    
    .card-center-section {
        margin: 0;
        width: 100%;
        justify-content: space-between;
    }
    
    .card-right-section {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        border-top: 1px solid var(--border-color);
        padding-top: 0.75rem;
    }
    
    .card-chevron {
        display: none;
    }
    
    .amount-label {
        font-size: 1rem;
    }
}

/* Empty State Styling */
.empty-state-container {
    background-color: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: 16px;
    padding: 3.5rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-icon {
    width: 54px;
    height: 54px;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state-container h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.empty-state-container p {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 320px;
    margin-bottom: 1.5rem;
}

.btn-clear-filters-empty {
    padding: 0.65rem 1.25rem;
    border-radius: 10px;
    border: none;
    background-color: var(--text-primary);
    color: var(--bg-primary);
    font-family: var(--font-family);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-clear-filters-empty:hover {
    opacity: 0.9;
}

/* ==========================================================================
   Details Modal / Right Drawer System
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    justify-content: flex-end; /* Drawer slide from right */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    width: 100%;
    max-width: 480px;
    height: 100%;
    background-color: var(--bg-card);
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 1px solid var(--border-color);
}

.modal-overlay.active .modal-card {
    transform: translateX(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-company-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.company-logo-large {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    border: 1px solid var(--border-color);
}

.modal-company-title h3 {
    font-size: 1.15rem;
    font-weight: 750;
    color: var(--text-primary);
    line-height: 1.2;
}

.modal-company-title p {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.modal-close:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-close i {
    width: 18px;
    height: 18px;
}

/* Modal Body Content */
.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-exchange-badge-row {
    display: flex;
    gap: 0.5rem;
}

/* Stats grid */
.modal-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.modal-stat-box {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 0.5rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.box-label {
    font-size: 0.65rem;
    font-weight: 650;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 2px;
    letter-spacing: 0.2px;
}

.box-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.box-value.highlight-green {
    color: var(--color-emerald);
}

.box-value.highlight-blue {
    color: var(--color-sky);
}

/* Timeline */
.modal-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-timeline h4, .modal-info-section h4 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.timeline-item {
    display: flex;
    gap: 1rem;
    position: relative;
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 17px;
    top: 36px;
    bottom: -20px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item:last-child::after {
    display: none;
}

.timeline-marker {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
}

.timeline-marker i {
    width: 18px;
    height: 18px;
}

.timeline-marker.ex-color {
    background-color: rgba(var(--color-gold-rgb), 0.1);
    color: var(--color-gold);
    border: 1px solid rgba(var(--color-gold-rgb), 0.2);
}

.timeline-marker.pay-color {
    background-color: rgba(var(--color-emerald-rgb), 0.1);
    color: var(--color-emerald);
    border: 1px solid rgba(var(--color-emerald-rgb), 0.2);
}

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.timeline-content h5 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.timeline-date {
    font-size: 0.95rem;
    font-weight: 700;
}

#modal-ex-date {
    color: var(--color-gold);
}

#modal-pay-date {
    color: var(--color-emerald);
}

.timeline-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Info section details */
.modal-info-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
}

.modal-info-section p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Modal Footer */
.modal-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-primary);
}

.btn-modal-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem;
    border-radius: 10px;
    background-color: var(--color-emerald);
    color: #ffffff;
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 650;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(var(--color-emerald-rgb), 0.2);
}

.btn-modal-action:hover {
    background-color: #0d9488;
    box-shadow: 0 6px 15px rgba(var(--color-emerald-rgb), 0.3);
    transform: translateY(-1px);
}

.btn-modal-action i {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.app-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 2.5rem 1.5rem 1.5rem 1.5rem;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.footer-info h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.footer-info h3 span {
    background: linear-gradient(90deg, var(--color-emerald), var(--color-sky));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-disclaimer p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
    text-align: justify;
}

.footer-bottom {
    max-width: 1280px;
    margin: 0 auto;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Educational Glossary & SEO FAQ Section
   ========================================================================== */

.education-seo-section {
    margin-top: 3rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .education-seo-section {
        grid-template-columns: 1fr;
    }
}

.edu-card, .faq-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.edu-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.edu-header i {
    width: 20px;
    height: 20px;
    color: var(--color-emerald);
}

.edu-header h2 {
    font-size: 1.1rem;
    font-weight: 750;
    color: var(--text-primary);
}

.edu-intro {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.glossary-item {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.85rem;
    transition: transform 0.2s ease, border-color 0.2s;
}

.glossary-item:hover {
    transform: translateY(-1px);
    border-color: var(--border-color-hover);
}

.glossary-item h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.glossary-item p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* FAQ Accordion Styling */
.faq-accordion {
    display: flex;
    flex-direction: column;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    cursor: pointer;
    user-select: none;
}

.faq-question:hover h3 {
    color: var(--color-emerald);
}

.faq-question h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.2s ease;
    padding-right: 1rem;
    line-height: 1.4;
}

.faq-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.faq-icon i {
    width: 16px;
    height: 16px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
    padding-top: 0;
    padding-bottom: 0;
}

.faq-answer p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Accordion Active States */
.faq-item.active .faq-answer {
    max-height: 250px;
    padding-bottom: 1rem;
}

.faq-item.active .faq-icon i {
    transform: rotate(45deg);
    color: var(--color-emerald);
}

/* ==========================================================================
   Recent Announcements Ticker Bar (High Contrast & Premium)
   ========================================================================== */

.announcements-ticker-bar {
    background-color: #0f172a; /* Contrasting dark charcoal for light mode */
    border-bottom: 2px solid var(--color-emerald); /* High contrast emerald green bottom border */
    height: 40px;
    display: flex;
    align-items: center;
    overflow: hidden;
    position: sticky;
    top: 4px;
    z-index: 1001; /* Above header */
    font-size: 0.78rem;
    transition: background-color 0.3s, border-color 0.3s;
}

[data-theme="dark"] .announcements-ticker-bar {
    background-color: #0a0e1c; /* Contrasting carbon black for dark mode */
    border-bottom: 2px solid var(--color-emerald);
}

/* Adjust header top margin since ticker is sticky */
.app-header {
    top: 44px; /* Ticker height (40px) + accent bar (4px) */
}

/* Sidebar sticky top alignment adjustments */
.sidebar-area {
    top: 125px; /* header + ticker alignment */
}

.ticker-label {
    background-color: var(--color-emerald); /* Solid green background in light mode */
    color: #ffffff; /* High contrast white text */
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    height: 100%;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    flex-shrink: 0;
}

[data-theme="dark"] .ticker-label {
    background-color: rgba(56, 189, 248, 0.15); /* Light blue transparent in dark mode */
    color: #38bdf8; /* Cyan text */
    border-right: 1px solid var(--border-color);
}

.ticker-label i {
    width: 14px;
    height: 14px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: #ffffff; /* White dot in light mode label */
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
    animation: tickerPulseLight 1.8s infinite;
}

[data-theme="dark"] .pulse-dot {
    background-color: #38bdf8; /* Cyan dot in dark mode label */
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.5);
    animation: tickerPulseDark 1.8s infinite;
}

@keyframes tickerPulseLight {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(255, 255, 255, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

@keyframes tickerPulseDark {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(56, 189, 248, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
    }
}

.ticker-content-wrapper {
    flex: 1;
    overflow: hidden;
    height: 100%;
    display: flex;
    align-items: center;
}

.ticker-content {
    display: flex;
    align-items: center;
    gap: 4rem;
    padding-left: 2rem;
    white-space: nowrap;
    animation: tickerMarquee 35s linear infinite; /* Slightly slower for 5 items readability */
}

.ticker-content:hover {
    animation-play-state: paused;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #e2e8f0; /* Off-white text in light mode (since ticker is dark) */
}

[data-theme="dark"] .ticker-item {
    color: #94a3b8; /* Slate text in dark mode */
}

.ticker-time {
    background-color: rgba(255, 255, 255, 0.1); /* Translucent in light mode */
    color: #e2e8f0;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
}

[data-theme="dark"] .ticker-time {
    background-color: #1e293b; /* Dark grey in dark mode */
    color: #94a3b8;
}

.ticker-ticker {
    color: #ffffff; /* White ticker symbol in light mode */
    font-weight: 700;
}

[data-theme="dark"] .ticker-ticker {
    color: var(--text-primary); /* Normal high-contrast text in dark mode */
}

@keyframes tickerMarquee {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

@media (max-width: 640px) {
    .ticker-label span {
        display: none; /* Hide label text on tiny screens, keep icon */
    }
}
