/* MODERN UI UPGRADE FOR AAV */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #eef2ff;
    --secondary: #64748b;
    --accent: #f43f5e;
    --success: #10b981;
    --warning: #f59e0b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --surface-muted: #f1f5f9;
    --empty-state-bg: #f8fafc;
    --empty-state-text: #64748b;
    --action-backup-bg: #eab308;
    --action-backup-text: #111827;
    --action-share-bg: #4f46e5;
    --action-share-text: #ffffff;
    --action-neutral-bg: #1e293b;
    --action-neutral-text: #ffffff;
    --system-bg: var(--surface);
    --system-text: var(--text-main);
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Glassmorphism & Modern Cards */
.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-md);
}

.modern-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

/* Buttons Upgrade */
.pressable-3d,
button,
.color-swatch,
.logo-container,
a.w-10 {
    position: relative;
    transform: translateY(0);
    box-shadow: 0 4px 0 rgba(15, 23, 42, 0.18), 0 10px 18px rgba(15, 23, 42, 0.12);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

button,
input[type="button"],
input[type="submit"],
input[type="reset"],
.btn-primary,
.btn-secondary,
.action-btn,
.group-add-btn,
.footer-icon-btn,
.export-format-btn {
    border-radius: 9999px !important;
}

.pressable-3d:hover,
button:hover,
.color-swatch:hover,
.logo-container:hover,
a.w-10:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(15, 23, 42, 0.2), 0 14px 24px rgba(15, 23, 42, 0.14);
    filter: saturate(1.05);
}

.pressable-3d:active,
button:active,
.color-swatch:active,
.logo-container:active,
a.w-10:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(15, 23, 42, 0.2), 0 5px 10px rgba(15, 23, 42, 0.12);
}

.footer-icon-btn {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.footer-icon-btn:hover,
.footer-icon-btn:focus-visible,
.footer-icon-btn:active {
    background: #020617;
    color: #f8fafc;
    border-color: #020617;
}

.footer-icon-btn:hover svg,
.footer-icon-btn:focus-visible svg,
.footer-icon-btn:active svg {
    color: #faff00;
}

.footer-icon-btn:focus-visible {
    outline: 2px solid #faff00;
    outline-offset: 2px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--surface);
    color: var(--secondary);
    border: 1px solid var(--border);
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--background);
    border-color: var(--secondary);
    color: var(--text-main);
}

.export-format-btn {
    background: var(--system-bg);
    color: var(--system-text);
    border: 1px solid var(--system-text);
    border-radius: var(--radius-sm);
    font-weight: 600;
    line-height: 1.2;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.1);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-surface-muted {
    background: var(--surface-muted);
    border-color: var(--border);
}

.action-btn {
    border-radius: var(--radius-md);
    padding: 0.625rem 1rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.action-btn-backup {
    background: var(--action-backup-bg);
    color: var(--action-backup-text);
}

.action-btn-share {
    background: var(--action-share-bg);
    color: var(--action-share-text);
}

.action-btn-neutral {
    background: var(--action-neutral-bg);
    color: var(--action-neutral-text);
}

.group-add-btn {
    background: var(--action-share-bg);
    color: var(--action-share-text);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
}

.empty-state-sync {
    background: var(--empty-state-bg);
    color: var(--empty-state-text);
    border-color: var(--border);
}

.export-format-btn:hover {
    background: var(--system-bg);
    color: var(--system-text);
    border-color: var(--system-text);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.2);
}

.export-format-btn--error,
.export-format-btn--error:hover {
    background: #b22222;
    color: #ffd700;
    border-color: #ffd700;
    box-shadow: inset 0 1px 0 rgb(255 215 0 / 0.35);
}

/* Tab Styling */
.tab-btn {
    position: relative;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s;
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

/* Input Styling */
input, textarea, select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    transition: all 0.2s;
    background: var(--surface);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Table Styling */
.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table th {
    background: var(--background);
    padding: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}

.modern-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.modern-table tr:last-child td {
    border-bottom: none;
}

.modern-table tr:hover td {
    background: var(--primary-light);
}

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

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

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

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
    border: 2px solid var(--background);
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Logo Animation */
.logo-container img {
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo-container:hover img {
    transform: rotate(5deg) scale(1.1);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    padding: 1.25rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* INTERACTIVE ANIMATIONS */
.click-effect {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: click-ripple 0.6s ease-out forwards;
    z-index: 9999;
}

@keyframes click-ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 0.8;
    }
    100% {
        width: 50px;
        height: 50px;
        opacity: 0;
        border-width: 1px;
    }
}



/* Touch feedback for mobile */
.touch-ripple {
    position: absolute;
    background: rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    transform: scale(0);
    animation: touch-ripple-anim 0.6s linear;
    pointer-events: none;
}

@keyframes touch-ripple-anim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Ensure smooth transitions */
body {
    transition: background-color 0.3s, color 0.3s;
}

.modern-card, input, select, textarea {
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

/* Settings UI Styles */
.settings-panel {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--surface);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    border-left: 1px solid var(--border);
    padding: 2rem;
    overflow-y: auto;
}

.settings-panel.active {
    display: block;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.settings-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    backdrop-filter: blur(4px);
}

.settings-overlay.active {
    display: block;
}

.color-swatch {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.active {
    border-color: var(--text-main);
}
