/* ============================================
   NSTrack Portal - Modern Dark Theme
   ============================================ */

:root {
    /* Primary Colors */
    --primary: #f43f5e;
    --primary-dark: #e11d48;
    --primary-light: #fb7185;
    --primary-glow: rgba(244, 63, 94, 0.3);
    
    /* Background Colors */
    --bg-darkest: #0a0a0f;
    --bg-dark: #0f1117;
    --bg-card: #151821;
    --bg-card-hover: #1a1f2e;
    --bg-elevated: #1e2433;
    
    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Border Colors */
    --border: #1e293b;
    --border-light: #334155;
    
    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* Spacing */
    --sidebar-width: 260px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-darkest);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-dark);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary-glow) 0%, transparent 100%);
    color: var(--primary-light);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border);
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, var(--bg-darkest) 0%, #0d0d14 100%);
    padding: 24px 32px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* User Menu in Sidebar */
.user-menu-sidebar {
    position: relative;
}

.user-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.user-nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.user-nav-item .nav-icon {
    color: var(--primary);
}

.user-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chevron-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.user-menu-sidebar.open .chevron-icon {
    transform: rotate(180deg);
}

.user-dropdown-sidebar {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-fast);
    z-index: 100;
    overflow: hidden;
}

.user-menu-sidebar.open .user-dropdown-sidebar {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item-sidebar {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.dropdown-item-sidebar:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.dropdown-item-sidebar svg {
    width: 24px;
    height: 18px;
}

.dropdown-item-sidebar:hover svg {
    color: var(--text-primary);
}

.dropdown-item-sidebar.dropdown-item-active {
    color: var(--primary-light);
}

.dropdown-item-sidebar.dropdown-item-active svg {
    color: var(--primary);
}

#logout-btn:hover {
    color: var(--error);
}

#logout-btn:hover svg {
    color: var(--error);
}

/* ============================================
   Search Section
   ============================================ */
.search-section {
    margin-bottom: 32px;
}

.search-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.search-form {
    display: grid;
    grid-template-columns: 1fr 1fr 120px auto auto;
    gap: 20px;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-select,
.form-input {
    padding: 14px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.form-select:hover,
.form-input:hover {
    border-color: var(--border-light);
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-select option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Checkbox Group */
.form-group-checkbox {
    justify-content: flex-end;
    padding-bottom: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox-input {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    position: relative;
    transition: all var(--transition-fast);
}

.checkbox-input:checked + .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-input:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.info-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    cursor: help;
    transition: color var(--transition-fast);
}

.info-icon:hover {
    color: var(--primary);
}

.tooltip-content {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 280px;
    white-space: normal;
    text-align: center;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border);
}

.tooltip-wrapper:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 16px var(--primary-glow);
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--primary-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-icon {
    width: 18px;
    height: 18px;
}

/* ============================================
   Stats Section
   ============================================ */
.stats-section {
    margin-bottom: 32px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all var(--transition-fast);
}

.stat-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.stat-card-guarantee {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, var(--bg-card) 100%);
    border-color: rgba(16, 185, 129, 0.3);
}

.stat-card-guarantee .stat-icon {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
}

.stat-card-guarantee .stat-icon svg {
    stroke: var(--success);
}

.stat-card-guarantee:hover {
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.15);
}

.stat-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-glow) 0%, transparent 100%);
    border-radius: var(--radius-md);
    color: var(--primary);
}

.stat-icon svg {
    width: 26px;
    height: 26px;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Chart Card */
.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.chart-header {
    margin-bottom: 20px;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chart-bar {
    display: flex;
    align-items: center;
    gap: 16px;
}

.chart-label {
    width: 60px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
}

.chart-bar-container {
    flex: 1;
    height: 28px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.chart-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-sm);
    transition: width 0.5s ease;
    position: relative;
}

.chart-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
}

.chart-value {
    width: 60px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================
   Results Section
   ============================================ */
.results-section {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.results-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 6px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.results-table {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-header {
    display: grid;
    grid-template-columns: 140px 1fr 120px 180px;
    gap: 16px;
    padding: 16px 24px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.th-cell {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.table-body {
    max-height: 500px;
    overflow-y: auto;
}

.table-row {
    display: grid;
    grid-template-columns: 140px 1fr 120px 180px;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    transition: background var(--transition-fast);
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:hover {
    background: var(--bg-card-hover);
}

.td-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.td-tracking {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tracking-number {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.btn-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-copy:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-copy svg {
    width: 16px;
    height: 16px;
}

.td-country {
    display: flex;
    align-items: center;
    gap: 8px;
}

.country-flag {
    font-size: 1.2rem;
}

.country-code {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 4px 10px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
}

.td-actions {
    display: flex;
    gap: 8px;
}

.btn-track {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-track:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-track svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    text-align: center;
    padding: 32px 0 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: slideIn 0.3s ease;
    min-width: 280px;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

.toast.toast-success {
    border-left: 3px solid var(--success);
}

.toast.toast-error {
    border-left: 3px solid var(--error);
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error .toast-icon {
    color: var(--error);
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* ============================================
   Loading State
   ============================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1200px) {
    .search-form {
        grid-template-columns: 1fr 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .search-form {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 100px 1fr 80px 120px;
        gap: 12px;
        padding: 12px 16px;
    }
}

/* ============================================
   Custom Flag Emoji Support
   ============================================ */
.flag-icon {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
}

/* ============================================
   Balance Indicator in Header
   ============================================ */
.balance-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.balance-indicator:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-color: rgba(16, 185, 129, 0.5);
    transform: translateY(-1px);
}

.balance-icon {
    width: 20px;
    height: 20px;
    color: var(--success);
}

.balance-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--success);
}

.balance-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================
   Confirmation Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: all var(--transition-normal);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.confirm-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.confirm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.confirm-row-total {
    padding: 16px 0;
    margin: 8px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.confirm-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.confirm-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.confirm-value-total {
    font-size: 1.2rem;
    color: var(--primary);
}

.confirm-warning {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--error);
}

.confirm-warning a {
    color: var(--primary);
    text-decoration: underline;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
}

.btn-secondary {
    flex: 1;
    padding: 12px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.modal-footer .btn-primary {
    flex: 1;
}

/* ============================================
   Balance Page Styles
   ============================================ */
.balance-section {
    margin-bottom: 32px;
}

.balance-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
}

.balance-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
}

.balance-card-main {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, var(--bg-card) 100%);
    border-color: rgba(16, 185, 129, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.balance-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.balance-card-icon {
    width: 32px;
    height: 32px;
    color: var(--success);
}

.balance-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.balance-card-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--success);
    line-height: 1.2;
    margin-bottom: 8px;
}

.balance-card-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.pricing-cards {
    display: flex;
    gap: 20px;
}

.pricing-card {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
}

.pricing-card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.pricing-card-header svg {
    width: 20px;
    height: 20px;
}

.pricing-card-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.pricing-card-value span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
}

.pricing-card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pricing-card-guarantee {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.1) 0%, var(--bg-card) 100%);
    border-color: rgba(244, 63, 94, 0.3);
}

.pricing-card-guarantee .pricing-card-header {
    color: var(--primary-light);
}

.pricing-card-guarantee .pricing-card-value {
    color: var(--primary);
}

/* Info Section */
.info-section {
    margin-bottom: 32px;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px;
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.info-card-header svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.info-card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.info-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.info-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.info-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

.info-text strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.info-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Cashback Section */
.cashback-section {
    margin-bottom: 32px;
}

.cashback-card {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, var(--bg-card) 100%);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: var(--radius-xl);
    padding: 28px;
}

.cashback-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.cashback-header svg {
    width: 28px;
    height: 28px;
    color: #fbbf24;
}

.cashback-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.cashback-subtitle {
    margin-left: auto;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    padding: 6px 14px;
    border-radius: var(--radius-lg);
}

.cashback-tiers {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.cashback-tier {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    position: relative;
    transition: all var(--transition-fast);
}

.cashback-tier:hover {
    transform: translateY(-2px);
    border-color: var(--border-light);
}

.tier-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
}

.tier-popular .tier-badge {
    background: #8b5cf6;
}

.tier-best .tier-badge {
    background: #fbbf24;
    color: #0a0a0f;
}

.tier-range {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.tier-percent {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.tier-example {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Bank Section */
.bank-section {
    margin-bottom: 32px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.section-title svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.bank-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.bank-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.bank-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.bank-flag {
    font-size: 2rem;
}

.bank-card-title {
    display: flex;
    gap: 4px;
}

.currency-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    width: fit-content;
    margin-left: 5px;
}

.currency-badge-eur {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.currency-badge-gbp {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.bank-details {
    padding: 16px 20px;
}

.bank-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.bank-row:last-child {
    border-bottom: none;
}

.bank-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.bank-value {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

.bank-value.copyable {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.bank-value.copyable:hover {
    color: var(--primary);
}

.bank-value.copyable svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.5;
}

.bank-value.copyable:hover svg {
    opacity: 1;
}

.bank-notice {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: var(--radius-lg);
}

.bank-notice svg {
    width: 24px;
    height: 24px;
    color: #fbbf24;
    flex-shrink: 0;
}

.bank-notice div {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.bank-notice strong {
    color: var(--text-primary);
}

/* Transactions Section */
.transactions-section {
    margin-bottom: 32px;
}

.transactions-table {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.transactions-table .table-header {
    grid-template-columns: 180px 100px 1fr 120px 120px;
}

.transactions-table .table-row {
    display: grid;
    grid-template-columns: 180px 100px 1fr 120px 120px;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.td-cell {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.td-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.tx-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.tx-deposit {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.tx-purchase {
    background: rgba(244, 63, 94, 0.2);
    color: var(--primary);
}

.tx-refund {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.tx-amount-positive {
    color: var(--success);
    font-weight: 600;
}

.tx-amount-negative {
    color: var(--error);
    font-weight: 600;
}

/* Balance Page Responsive */
@media (max-width: 1200px) {
    .balance-grid {
        grid-template-columns: 1fr;
    }
    
    .bank-cards {
        grid-template-columns: 1fr;
    }
    
    .cashback-tiers {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .info-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .pricing-cards {
        flex-direction: column;
    }
    
    .cashback-tiers {
        grid-template-columns: 1fr;
    }
    
    .transactions-table .table-header,
    .transactions-table .table-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .td-description {
        grid-column: 1 / -1;
    }
}

/* ============================================
   My Trackings Page Styles
   ============================================ */

/* Filters form */
.filters-form {
    grid-template-columns: 1fr 1fr 2fr auto auto;
}

.form-group-search {
    min-width: 200px;
}

.btn-export {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
}

.btn-export .btn-icon {
    width: 18px;
    height: 18px;
}

/* Table for My Trackings */
.table-header-mytrackings {
    grid-template-columns: 160px 1fr 100px 120px 120px;
}

.table-row-mytrackings {
    grid-template-columns: 160px 1fr 100px 120px 120px;
}

/* Type Badge */
.td-type {
    display: flex;
    align-items: center;
}

.type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.type-standard {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-secondary);
}

.type-guarantee {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn svg {
    width: 16px;
    height: 16px;
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* My Trackings Responsive */
@media (max-width: 1200px) {
    .filters-form {
        grid-template-columns: 1fr 1fr;
    }
    
    .form-group-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .table-header-mytrackings,
    .table-row-mytrackings {
        grid-template-columns: 100px 1fr 80px 100px;
    }
    
    .td-actions {
        display: none;
    }
    
    .pagination {
        flex-direction: column;
        gap: 12px;
    }
}

