/* GTA 5 Reseller Calc - Modern Glassy Finance Design System */

:root {
    --bg-primary: #0a0715;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-bg-hover: rgba(255, 255, 255, 0.06);
    --glass-bg-active: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-focus: rgba(var(--accent-purple-rgb), 0.4);
    
    --accent-purple: #7c4dff;
    --accent-purple-glow: rgba(var(--accent-purple-rgb), 0.3);
    --accent-purple-secondary: #b388ff;
    --accent-purple-hover: #651fff;
    --accent-purple-rgb: 124, 77, 255;
    --accent-green: #00e676;
    --accent-green-glow: rgba(0, 230, 118, 0.2);
    --accent-red: #ff5252;
    --accent-red-glow: rgba(255, 82, 82, 0.2);
    
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --transition-speed: 0.25s;
}

/* Base resets & theme setup */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

/* Custom premium scrollbar for inner scrollable containers */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    transition: background var(--transition-speed);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}

/* Hide scrollbars globally on html and body to look like a native app */
html, body {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
}
html::-webkit-scrollbar, body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(90, 40, 200, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 230, 118, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, #0d091d 0%, #06040a 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* App container */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 110px; /* Safe padding for bottom dock */
}

/* Page states */
.page {
    display: none;
    padding: 24px 16px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.page.active {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Premium Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.6rem;
    color: var(--text-primary);
}

.text-success { color: var(--accent-green) !important; }
.text-danger { color: var(--accent-red) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Header Layout */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-secondary));
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(var(--accent-purple-rgb), 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Status indicator badge */
.status-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(10px);
}

.status-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-badge.connected .dot {
    background-color: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
    animation: pulseGlow 2s infinite;
}

.status-badge.error .dot {
    background-color: var(--accent-red);
    box-shadow: 0 0 8px var(--accent-red);
}

.status-badge.loading .dot {
    background-color: #ffb300;
    box-shadow: 0 0 8px #ffb300;
}

@keyframes pulseGlow {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
    transition: transform var(--transition-speed) ease, border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.glass-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.35);
}

/* Dashboard Main Metric Card */
.main-metric {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.main-metric::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(var(--accent-purple-rgb), 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.main-metric h2 {
    font-size: 2.8rem;
    font-weight: 800;
    margin: 4px 0 8px;
    background: linear-gradient(to right, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: var(--accent-green);
}

/* Balance actions and layout utilities */
.balance-card {
    margin-bottom: 16px;
}

.balance-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.75rem;
    border-radius: 8px;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 2px 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-purple);
    margin-left: 8px;
    vertical-align: middle;
    box-shadow: 0 0 10px rgba(var(--accent-purple-rgb), 0.15);
}

/* Stats 2x2 Grid */
.grid {
    display: grid;
    gap: 12px;
}

.stats-grid {
    grid-template-columns: 1fr 1fr;
    margin-bottom: 16px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}

.buy-icon {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.sell-icon {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.count-icon {
    background: rgba(var(--accent-purple-rgb), 0.1);
    color: var(--accent-purple);
    border: 1px solid rgba(var(--accent-purple-rgb), 0.2);
}

.active-icon {
    background: rgba(0, 230, 118, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(0, 230, 118, 0.2);
}

.stat-content span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
}

.stat-content p {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Progress bar indicators */
.progress-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.progress-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-green));
    border-radius: 4px;
    transition: width 0.8s ease-out;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Sections layouts */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

/* Search bar styling */
.search-box {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.search-box input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 12px 16px 12px 42px;
    color: white;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.search-box input:focus {
    border-color: var(--glass-border-focus);
    box-shadow: 0 0 10px var(--accent-purple-glow);
}

/* Deals card list */
.deals-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 0.9rem;
}

/* Individual deal cards */
.deal-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
}

.deal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.deal-card-title h4 {
    font-size: 1.05rem;
    font-weight: 600;
}

.deal-card-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.deal-card-status {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
}

.deal-card-status.active {
    color: #ffb300;
    background: rgba(255, 179, 0, 0.1);
}

.deal-card-status.sold {
    color: var(--accent-green);
    background: rgba(0, 230, 118, 0.1);
}

.deal-card-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    text-align: center;
}

.deal-metric-block span {
    font-size: 0.65rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 2px;
}

.deal-metric-block p {
    font-size: 0.85rem;
    font-weight: 700;
}

.deal-card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 12px;
}

.deal-profit-label {
    margin-right: auto;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.1s, opacity var(--transition-speed), filter var(--transition-speed);
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-hover));
    color: white;
    box-shadow: 0 4px 15px var(--accent-purple-glow);
}

.btn-primary:hover {
    filter: brightness(1.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: white;
}

.btn-secondary:hover {
    background: var(--glass-bg-hover);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-green), #00c853);
    color: #05040a;
    font-weight: 700;
    box-shadow: 0 4px 15px var(--accent-green-glow);
}

.btn-success:hover {
    filter: brightness(1.1);
}

.btn-danger-icon {
    background: rgba(255, 82, 82, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(255, 82, 82, 0.2);
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color var(--transition-speed), transform 0.1s;
}

.btn-danger-icon:hover {
    background: rgba(255, 82, 82, 0.2);
}

.btn-danger-icon:active {
    transform: scale(0.92);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input, .form-group select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    font-size: 0.9rem;
    color: white;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--glass-border-focus);
    box-shadow: 0 0 8px var(--accent-purple-glow);
}

/* Settings elements */
.profile-details-card, .credentials-card, .instructions-card {
    padding: 20px;
}

.profile-details-card h3, .credentials-card h3, .instructions-card h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.profile-row:last-child {
    border-bottom: none;
}

.profile-row .label {
    color: var(--text-secondary);
}

.profile-row .val {
    font-weight: 600;
    color: var(--text-primary);
}

.settings-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.settings-actions .btn {
    flex: 1;
}

/* Step list for bot integration instructions */
.step-list {
    margin-left: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.step-list li {
    line-height: 1.4;
}

.step-list code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: #e2e8f0;
}

.step-list a {
    color: var(--accent-purple);
    text-decoration: none;
}

.step-list a:hover {
    text-decoration: underline;
}

/* Modals & Overlays */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 4, 10, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Mobile friendly slide-up from bottom */
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed) ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    margin: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-radius: 28px 28px 0 0; /* Rounded top only for bottom-sheet effect */
    transform: translateY(100%);
    transition: transform var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(18, 14, 38, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: none;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.3rem;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: color var(--transition-speed);
}

.btn-close:hover {
    color: white;
}

.modal-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 24px;
}

.modal-footer .btn {
    flex: 1;
}

/* Floating Navigation Dock */
.glass-dock {
    position: fixed;
    bottom: 24px;
    left: 16px;
    right: 16px;
    max-width: 568px; /* 600px page max - 32px padding margins */
    margin: 0 auto;
    background: rgba(13, 9, 29, 0.7);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    display: flex;
    justify-content: space-around;
    padding: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 900;
}

.dock-item {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    flex: 1;
    cursor: pointer;
    border-radius: 18px;
    transition: color var(--transition-speed) ease, background-color var(--transition-speed) ease, transform 0.1s;
}

.dock-item i {
    font-size: 1.4rem;
    transition: transform var(--transition-speed) ease;
}

.dock-item span {
    font-size: 0.65rem;
    font-weight: 500;
}

.dock-item.active {
    color: var(--accent-purple);
    background: rgba(var(--accent-purple-rgb), 0.08);
}

.dock-item.active i {
    transform: translateY(-2px);
}

.dock-item:active {
    transform: scale(0.92);
}

/* ===================================
   Dashboard Period Filter Toggle Pill
   =================================== */
.period-toggle-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.period-toggle {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 4px;
    gap: 4px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.period-btn {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 7px 18px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color var(--transition-speed) ease,
                background var(--transition-speed) ease,
                box-shadow var(--transition-speed) ease,
                transform 0.1s;
    white-space: nowrap;
}

.period-btn i {
    font-size: 0.9rem;
}

.period-btn:active {
    transform: scale(0.93);
}

.period-btn.active {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-hover));
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(var(--accent-purple-rgb), 0.4);
}

.period-btn:not(.active):hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
}

/* Media Queries for Desktop and Larger Screens */
@media (min-width: 600px) {
    .modal-overlay {
        align-items: center;
        padding: 20px;
    }
    
    .modal-content {
        border-radius: 24px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        transform: scale(0.9);
    }
    
    .modal-overlay.active .modal-content {
        transform: scale(1);
    }
    
    @keyframes scaleIn {
        from { opacity: 0; transform: scale(0.9); }
        to { opacity: 1; transform: scale(1); }
    }
}

/* ====================== PRELOADER ====================== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #1a1b2e, #0f0f1a);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.6s ease;
}

.preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    text-align: center;
}

.logo-circle {
    width: 92px;
    height: 92px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 45px rgba(139, 92, 246, 0.6);
    animation: logoPulse 2s infinite ease-in-out;
}

.logo-text {
    font-size: 36px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -3px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 54px;
    height: 54px;
    border: 5px solid rgba(139, 92, 246, 0.2);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-text {
    color: #a5b4fc;
    font-size: 15.5px;
    font-weight: 500;
    letter-spacing: 0.6px;
}

/* Анимации */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.07); }
}

/* Пагинация (страницы) */
.pagination-controls {
    display: none;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    margin-bottom: 8px;
}

.pagination-info {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Картинка лота внутри карточки сделки */
.deal-card-image {
    width: 100%;
    height: 160px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
}

.deal-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed) ease;
}

.deal-card-image img:hover {
    transform: scale(1.04);
}

/* Telegram Login & Device Sync Styling */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(90, 40, 200, 0.22) 0%, transparent 45%),
        radial-gradient(circle at 90% 80%, rgba(0, 230, 118, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, #0a0715 0%, #04030a 100%);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    padding: 32px 24px;
    border-radius: 28px;
    animation: loginSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes loginSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-header .logo-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-secondary));
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(var(--accent-purple-rgb), 0.35);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.login-header .logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.5px;
}

.login-header h2 {
    font-size: 1.7rem;
    font-weight: 800;
    margin-bottom: 4px;
    background: linear-gradient(to right, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-body {
    margin-bottom: 24px;
}

.login-body .form-group {
    margin-bottom: 18px;
}

.login-body label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.login-body label i {
    color: var(--accent-purple);
    margin-right: 4px;
}

.login-body input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    color: white;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: all var(--transition-speed) ease;
    text-align: center;
}

.login-body input:focus {
    outline: none;
    border-color: var(--accent-purple);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 12px var(--accent-purple-glow);
}

.login-footer {
    border-top: 1px solid var(--glass-border);
    padding-top: 20px;
}

.login-footer h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-footer ol {
    padding-left: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.login-footer li {
    margin-bottom: 8px;
    line-height: 1.45;
}

.login-footer li strong {
    color: var(--text-primary);
}

/* Adjustments for Settings Card Layout */
.sync-settings-card {
    border: 1px solid rgba(var(--accent-purple-rgb), 0.2);
    box-shadow: 0 8px 32px 0 rgba(var(--accent-purple-rgb), 0.05);
}
.sync-settings-card:hover {
    border-color: rgba(var(--accent-purple-rgb), 0.35);
}

/* History Filters Panel */
.filters-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    padding: 16px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.015);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

/* Category badges */
.category-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    vertical-align: middle;
}
.category-badge.cat-car { color: #b388ff !important; background: rgba(124, 77, 255, 0.1) !important; }
.category-badge.cat-moto { color: #80d8ff !important; background: rgba(0, 176, 255, 0.1) !important; }
.category-badge.cat-estate { color: #69f0ae !important; background: rgba(0, 230, 118, 0.1) !important; }
.category-badge.cat-numbers { color: #ffe57f !important; background: rgba(255, 235, 59, 0.1) !important; }
.category-badge.cat-clothing { color: #ff8a80 !important; background: rgba(255, 82, 82, 0.1) !important; }
.category-badge.cat-other { color: #cfd8dc !important; background: rgba(207, 216, 220, 0.1) !important; }
.category-badge.cat-rental { color: #90caf9 !important; background: rgba(144, 202, 249, 0.1) !important; }

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-group select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 8px 12px;
    color: white;
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: border-color var(--transition-speed);
    width: 100%;
}

.filter-group select:focus {
    border-color: var(--glass-border-focus);
}

.filter-sort-controls {
    display: flex;
    gap: 8px;
}

/* Mobile responsive adjustments */
@media (max-width: 580px) {
    .filters-panel {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
    }
}

.theme-btn {
    transition: transform var(--transition-speed), border-color var(--transition-speed), background var(--transition-speed) !important;
}
.theme-btn:active {
    transform: scale(0.95);
}
.theme-btn.active {
    border-color: var(--accent-purple) !important;
    background: rgba(var(--accent-purple-rgb), 0.1) !important;
    box-shadow: 0 0 10px rgba(var(--accent-purple-rgb), 0.15) !important;
}