/**
 * CryptoFolio - Cryptocurrency Portfolio Tracker
 * Stylesheet - styles.css
 * 
 * A modern, responsive, and themeable design for crypto portfolio tracking.
 * Uses CSS custom properties for easy theming and consistent spacing.
 */

/* ============================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ============================================ */

:root {
    /* Spacing Scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Font Sizes */
    --text-xs: 12px;
    --text-sm: 14px;
    --text-base: 16px;
    --text-lg: 18px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 32px;

    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.2);

    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal-backdrop: 300;
    --z-modal: 400;
    --z-toast: 500;
    --z-loading: 600;

    /* Layout */
    --header-height: 70px;
    --nav-height: 56px;
    --max-width: 1400px;
    --sidebar-width: 280px;
}

/* Dark Theme (Default) */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --bg-card-hover: #273548;
    --bg-input: #0f172a;
    --bg-input-focus: #1e293b;

    --border-color: rgba(148, 163, 184, 0.1);
    --border-color-focus: #6366f1;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;

    --accent-primary: #6366f1;
    --accent-primary-hover: #7c7ff2;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);

    --chart-colors: #6366f1, #8b5cf6, #ec4899, #f43f5e, #f97316, #eab308, #22c55e, #14b8a6, #06b6d4, #3b82f6;

    --scrollbar-bg: #1e293b;
    --scrollbar-thumb: #475569;

    --modal-backdrop: rgba(0, 0, 0, 0.7);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #ffffff;
    --bg-input-focus: #f8fafc;

    --border-color: rgba(15, 23, 42, 0.1);
    --border-color-focus: #6366f1;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #f1f5f9;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08);

    --scrollbar-bg: #f1f5f9;
    --scrollbar-thumb: #cbd5e1;

    --modal-backdrop: rgba(0, 0, 0, 0.5);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

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

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

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

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

/* Focus Styles */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background-color: var(--accent-primary);
    color: white;
}

/* Links */
a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-primary-hover);
}

/* ============================================
   PRIVACY BANNER
   ============================================ */

.privacy-banner {
    background: var(--accent-gradient);
    color: white;
    padding: var(--space-sm) var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.privacy-banner.hidden {
    display: none;
}

.privacy-icon {
    font-size: var(--text-lg);
}

.privacy-close {
    position: absolute;
    right: var(--space-md);
    background: transparent;
    border: none;
    color: white;
    font-size: var(--text-xl);
    cursor: pointer;
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.privacy-close:hover {
    opacity: 1;
}

/* ============================================
   HEADER
   ============================================ */

.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    backdrop-filter: blur(10px);
}

.header-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.logo-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    font-size: var(--text-2xl);
}

.logo-text {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-tagline {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: var(--font-medium);
}

.portfolio-summary {
    display: flex;
    gap: var(--space-xl);
    flex: 1;
    justify-content: center;
}

.portfolio-summary > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.portfolio-summary .label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.portfolio-summary .value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.btn-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: var(--text-lg);
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.btn-support {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(135deg, #ff813f 0%, #ffdd00 100%);
    border: none;
    border-radius: var(--radius-md);
    color: #1a1a1a;
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-support:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 129, 63, 0.4);
}

.mobile-menu-btn {
    display: none;
}

/* ============================================
   NAVIGATION
   ============================================ */

.navigation {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: var(--header-height);
    z-index: var(--z-sticky);
}

.nav-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-content::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

.nav-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.nav-icon {
    font-size: var(--text-lg);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-lg);
    min-height: calc(100vh - var(--header-height) - var(--nav-height) - 60px);
}

.tab-panel {
    display: none;
    animation: fadeIn var(--transition-normal);
}

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

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

/* ============================================
   STATS GRID
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stats-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: all var(--transition-fast);
}

.stat-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: var(--text-2xl);
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.stat-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
}

.stat-value.gain,
.gain {
    color: var(--success);
}

.stat-value.loss,
.loss {
    color: var(--danger);
}

.stat-value.neutral,
.neutral {
    color: var(--text-secondary);
}

.score-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    margin-top: var(--space-sm);
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    overflow: hidden;
}

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

.card-header h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.card-content {
    padding: var(--space-lg);
}

.card-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Collapsible Cards */
.collapsible .collapsible-header {
    cursor: pointer;
    user-select: none;
}

.collapsible .collapsible-header:hover {
    background: var(--bg-card-hover);
}

.collapsible .collapse-icon {
    transition: transform var(--transition-fast);
}

.collapsible.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.collapsible.collapsed .collapsible-content {
    display: none;
}

/* Goal Card */
.goal-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
}

.goal-content {
    padding: var(--space-lg);
}

.goal-progress {
    margin-bottom: var(--space-md);
}

.progress-bar {
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.goal-stats {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-sm);
}

.goal-stats span:first-child {
    font-weight: var(--font-bold);
}

.goal-stats span:last-child {
    color: var(--text-muted);
}

.goal-percentage {
    text-align: center;
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--accent-primary);
}

/* Quote Card */
.quote-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.quote-icon {
    font-size: var(--text-2xl);
}

.quote-text {
    font-style: italic;
    color: var(--text-secondary);
}

/* Support Card */
.support-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: var(--accent-primary);
}

.support-message {
    margin-bottom: var(--space-lg);
    color: var(--text-secondary);
}

.support-buttons {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* Warning Card */
.warning-card {
    border-color: var(--warning);
    background: var(--warning-bg);
}

.warning-list {
    list-style: none;
}

.warning-list li {
    padding: var(--space-sm) 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--warning);
}

/* ============================================
   FORMS
   ============================================ */

.form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    height: 44px;
    padding: 0 var(--space-md);
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-base);
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-group textarea {
    height: auto;
    padding: var(--space-md);
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent-primary);
    background: var(--bg-input-focus);
    outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.form-error {
    font-size: var(--text-xs);
    color: var(--danger);
    min-height: 16px;
}

.form-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-sm);
}

/* Range Slider */
.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    outline: none;
    margin: var(--space-sm) 0;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.2);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Filters */
.filters-row {
    display: flex;
    gap: var(--space-md);
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    min-width: 120px;
}

.filter-group label {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.filter-group input,
.filter-group select {
    height: 40px;
    padding: 0 var(--space-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-sm);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    height: 44px;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

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

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-text {
    background: transparent;
    color: var(--accent-primary);
    padding: var(--space-sm);
    height: auto;
}

.btn-text:hover {
    color: var(--accent-primary-hover);
    text-decoration: underline;
}

.btn-info {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    font-size: var(--text-sm);
    padding: 0;
}

.btn-info:hover {
    text-decoration: underline;
}

.btn-coffee {
    background: linear-gradient(135deg, #ff813f 0%, #ffdd00 100%);
    color: #1a1a1a;
}

.btn-coffee:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 129, 63, 0.4);
}

.btn-large {
    height: 52px;
    padding: var(--space-md) var(--space-xl);
    font-size: var(--text-base);
}

.btn-copy {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn-pagination {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-pagination:hover:not(:disabled) {
    background: var(--accent-primary);
    color: white;
}

.btn-pagination:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   TABLES
   ============================================ */

.table-container {
    overflow-x: auto;
    margin: 0 calc(-1 * var(--space-lg));
    padding: 0 var(--space-lg);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.data-table th,
.data-table td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-tertiary);
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.data-table th[data-sort] {
    cursor: pointer;
    user-select: none;
}

.data-table th[data-sort]:hover {
    color: var(--accent-primary);
}

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

.data-table tbody tr:hover:not(.empty-state) {
    background: var(--bg-card-hover);
}

.data-table tbody tr:nth-child(even):not(.empty-state) {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .data-table tbody tr:nth-child(even):not(.empty-state) {
    background: rgba(255, 255, 255, 0.02);
}

.data-table .coin-cell {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: var(--font-semibold);
}

.data-table .coin-icon {
    width: 28px;
    height: 28px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
}

.data-table .actions-cell {
    display: flex;
    gap: var(--space-xs);
}

.data-table .action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: var(--text-sm);
}

.data-table .action-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.data-table .action-btn.delete:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* Empty State */
.empty-state td {
    padding: var(--space-2xl);
}

.empty-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    color: var(--text-muted);
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    opacity: 0.5;
}

/* Transaction Type Badges */
.type-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
}

.type-badge.buy {
    background: var(--success-bg);
    color: var(--success);
}

.type-badge.sell {
    background: var(--danger-bg);
    color: var(--danger);
}

.type-badge.transfer {
    background: var(--info-bg);
    color: var(--info);
}

.type-badge.staking,
.type-badge.airdrop {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-secondary);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.page-info {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* ============================================
   CHARTS
   ============================================ */

.chart-container {
    position: relative;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-container canvas {
    max-width: 100%;
    max-height: 100%;
}

.chart-empty {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    color: var(--text-muted);
}

.chart-empty.hidden {
    display: none;
}

/* ============================================
   TAX CENTER
   ============================================ */

.tax-settings {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.tax-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.tax-item {
    background: var(--bg-tertiary);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    text-align: center;
}

.tax-item.highlight {
    background: var(--accent-gradient);
    color: white;
}

.tax-label {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.tax-item.highlight .tax-label {
    color: rgba(255, 255, 255, 0.8);
}

.tax-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
}

.tax-breakdown {
    margin-top: var(--space-xl);
}

.tax-breakdown h4 {
    margin-bottom: var(--space-md);
}

.breakdown-table-container {
    max-height: 300px;
    overflow-y: auto;
}

.tax-year {
    padding: var(--space-xs) var(--space-sm);
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
}

/* Harvesting List */
.harvesting-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.harvest-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--danger);
}

.harvest-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.harvest-coin {
    font-weight: var(--font-semibold);
}

.harvest-details {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.harvest-loss {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--danger);
}

/* ============================================
   ANALYTICS
   ============================================ */

.simulator {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.simulation-results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.sim-result {
    background: var(--bg-tertiary);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    text-align: center;
}

.sim-result.highlight {
    background: var(--accent-gradient);
    color: white;
}

.sim-label {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.sim-result.highlight .sim-label {
    color: rgba(255, 255, 255, 0.8);
}

.sim-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
}

.performance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.performance-item {
    background: var(--bg-tertiary);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    text-align: center;
}

.performance-item.best {
    border: 2px solid var(--success);
}

.performance-item.worst {
    border: 2px solid var(--danger);
}

.perf-label {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.perf-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
}

/* ============================================
   SETTINGS
   ============================================ */

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-color);
}

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

.setting-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.setting-label {
    font-weight: var(--font-semibold);
}

.setting-description {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.theme-toggle-wrapper {
    display: flex;
    gap: var(--space-sm);
}

.theme-btn {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.theme-btn:hover:not(.active) {
    border-color: var(--accent-primary);
}

/* Data Actions */
.data-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.action-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.action-item.danger {
    background: var(--danger-bg);
    border: 1px solid var(--danger);
}

.action-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.action-label {
    font-weight: var(--font-semibold);
}

.action-description {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Privacy Info */
.privacy-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.privacy-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.privacy-item .privacy-icon {
    font-size: var(--text-xl);
    color: var(--success);
}

.privacy-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.privacy-title {
    font-weight: var(--font-semibold);
}

.privacy-desc {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* About */
.about-info {
    text-align: center;
}

.about-info p {
    margin-bottom: var(--space-sm);
}

.about-desc {
    color: var(--text-muted);
    max-width: 600px;
    margin: var(--space-md) auto 0;
}

/* ============================================
   ACHIEVEMENTS
   ============================================ */

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-md);
}

.achievement {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all var(--transition-fast);
}

.achievement.locked {
    opacity: 0.5;
    filter: grayscale(1);
}

.achievement.unlocked {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border: 1px solid var(--accent-primary);
    opacity: 1;
    filter: none;
}

.achievement-icon {
    font-size: var(--text-2xl);
}

.achievement-name {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
}

/* ============================================
   RECENT TRANSACTIONS
   ============================================ */

.recent-transactions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.recent-tx-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.recent-tx-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.recent-tx-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.recent-tx-coin {
    font-weight: var(--font-semibold);
}

.recent-tx-date {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.recent-tx-amount {
    font-weight: var(--font-semibold);
    text-align: right;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: var(--space-md) var(--space-lg);
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-privacy {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.footer-link {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--accent-primary-hover);
    text-decoration: underline;
}

/* ============================================
   MODALS
   ============================================ */

.modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: var(--modal-backdrop);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    transform: translateY(20px);
    transition: transform var(--transition-normal);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-content.modal-small {
    max-width: 400px;
}

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

.modal-header h2 {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-xl);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

/* Donation Modal Specific */
.donation-message {
    text-align: center;
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.donation-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.donation-options .btn-coffee {
    width: 100%;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 450px;
    pointer-events: auto;
    animation: slideIn var(--transition-normal) ease;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.info {
    border-left: 4px solid var(--info);
}

.toast-icon {
    font-size: var(--text-xl);
}

.toast-message {
    flex: 1;
    font-size: var(--text-sm);
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: var(--text-lg);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast.hiding {
    animation: slideOut var(--transition-normal) ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ============================================
   LOADING OVERLAY
   ============================================ */

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-loading);
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    color: white;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Inline Loading */
.loading-inline {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}

.loading-inline .spinner-small {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* Price Update Pulse */
.price-updating {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ============================================
   LAST UPDATED
   ============================================ */

.last-updated {
    font-size: var(--text-xs);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.record-count {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    :root {
        --header-height: auto;
    }

    .header-content {
        flex-wrap: wrap;
        gap: var(--space-md);
    }

    .portfolio-summary {
        order: 3;
        width: 100%;
        justify-content: space-around;
        padding-top: var(--space-md);
        border-top: 1px solid var(--border-color);
    }

    .btn-support .btn-text {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid-3 .stat-card:last-child {
        grid-column: span 2;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .simulation-results,
    .performance-grid {
        grid-template-columns: 1fr;
    }

    .tax-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .action-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }

    .action-item .btn {
        width: 100%;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .main-content {
        padding: var(--space-md);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid-3 .stat-card:last-child {
        grid-column: span 1;
    }

    .nav-content {
        padding: 0 var(--space-md);
    }

    .nav-tab {
        padding: var(--space-sm) var(--space-md);
    }

    .nav-text {
        display: none;
    }

    .nav-icon {
        font-size: var(--text-xl);
    }

    .card-header {
        padding: var(--space-md);
    }

    .card-content {
        padding: var(--space-md);
    }

    .achievements-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .achievement {
        padding: var(--space-sm);
    }

    .achievement-icon {
        font-size: var(--text-lg);
    }

    .achievement-name {
        font-size: 10px;
    }

    /* Convert tables to cards on mobile */
    .data-table thead {
        display: none;
    }

    .data-table tbody tr:not(.empty-state) {
        display: block;
        padding: var(--space-md);
        margin-bottom: var(--space-sm);
        background: var(--bg-tertiary);
        border-radius: var(--radius-md);
    }

    .data-table tbody td {
        display: flex;
        justify-content: space-between;
        padding: var(--space-xs) 0;
        border-bottom: 1px solid var(--border-color);
    }

    .data-table tbody td:last-child {
        border-bottom: none;
    }

    .data-table tbody td::before {
        content: attr(data-label);
        font-weight: var(--font-semibold);
        color: var(--text-muted);
    }

    .data-table .actions-cell {
        justify-content: flex-end;
    }

    .toast-container {
        left: var(--space-md);
        right: var(--space-md);
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    .footer-content {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }

    .tax-summary-grid {
        grid-template-columns: 1fr;
    }

    .support-buttons {
        flex-direction: column;
    }

    .support-buttons .btn {
        width: 100%;
    }
}

/* Large screens (1400px and above) */
@media (min-width: 1400px) {
    .main-content {
        padding: var(--space-xl) var(--space-2xl);
    }
}

/* Print Styles */
@media print {
    .header,
    .navigation,
    .footer,
    .toast-container,
    .modal,
    .btn,
    .form-actions {
        display: none !important;
    }

    .main-content {
        padding: 0;
    }

    .card {
        break-inside: avoid;
        border: 1px solid #ddd;
        margin-bottom: 20px;
    }

    body {
        background: white;
        color: black;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

.font-mono {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', monospace;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

.mb-0 {
    margin-bottom: 0;
}

.mt-lg {
    margin-top: var(--space-lg);
}

/* ============================================
   WELCOME MODAL SPECIAL STYLES
   ============================================ */

.welcome-content {
    max-width: 500px;
    border-top: 4px solid var(--accent-primary);
}

.heart-pulse {
    font-size: 48px;
    margin-bottom: var(--space-md);
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

.manifesto-text {
    font-size: var(--text-lg);
    line-height: 1.5;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.manifesto-sub {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.manifesto-box {
    background: var(--bg-tertiary);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    text-align: left;
    margin-bottom: var(--space-xl);
}

.manifesto-box p {
    margin-bottom: var(--space-md);
    font-size: var(--text-sm);
}

.manifesto-box p:last-child {
    margin-bottom: 0;
}

.feature-hook {
    color: var(--accent-primary);
    font-weight: var(--font-medium);
}

.welcome-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.full-width {
    width: 100%;
    justify-content: center;
}

.muted-link {
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-weight: var(--font-normal);
}

.muted-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}