/* ==========================================================================
   Tunnel Forde LK - Modern Design System Stylesheet
   ========================================================================== */

/* Design Tokens & Theme Variables */
:root {
    /* Light Theme Palette (Default) */
    --bg-app: #f4f6fa;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --border-color: #eef2f6;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --primary: #8b5cf6;
    --primary-light: rgba(139, 92, 246, 0.08);
    --secondary: #ec4899;
    --accent: #d946ef;
    
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.08);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.08);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.08);
    
    --primary-gradient: linear-gradient(135deg, #8b5cf6 0%, #db2777 100%);
    --active-nav-gradient: linear-gradient(135deg, #d946ef 0%, #db2777 100%);
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gold-gradient: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.02);
    --shadow-header: 0 4px 20px rgba(0, 0, 0, 0.01);
    --shadow-sidebar: 4px 0 25px rgba(0, 0, 0, 0.01);
    --shadow-modal: 0 25px 50px rgba(0, 0, 0, 0.08);
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-speed: 0.3s;
    --border-radius: 16px;
}

/* Dark Theme Palette (Toggled) */
body.dark-mode {
    --bg-app: #090d16;
    --bg-card: #111827;
    --bg-sidebar: #111827;
    --border-color: #1f2937;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --primary-light: rgba(167, 139, 250, 0.12);
    --success-light: rgba(52, 211, 153, 0.12);
    --warning-light: rgba(251, 191, 36, 0.12);
    --danger-light: rgba(248, 113, 113, 0.12);
    
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.25);
    --shadow-header: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-sidebar: 4px 0 25px rgba(0, 0, 0, 0.2);
    --shadow-modal: 0 25px 50px rgba(0, 0, 0, 0.5);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font-family: inherit;
    color: inherit;
}

/* Global Loading Spinner overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-speed) ease;
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Micro-animations */
.animate-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ----------------------------------------------------
   LOGIN LAYOUT
   ---------------------------------------------------- */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: radial-gradient(circle at top right, rgba(139, 92, 246, 0.1) 0%, transparent 40%),
                radial-gradient(circle at bottom left, rgba(217, 70, 239, 0.1) 0%, transparent 40%);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-modal);
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-header .brand-logo.large {
    font-size: 3.5rem;
    margin-bottom: 1.25rem;
}

.login-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.login-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Alerts */
.alert {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    text-align: left;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    line-height: 1.4;
}

.alert-info {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(139, 92, 246, 0.15);
}

/* Premium Google Sign-In Button */
.google-auth-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    padding: 0.85rem 1.4rem;
    background: #ffffff;
    color: #1f2937;
    border: 1.5px solid #e5e7eb;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.google-auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(66, 133, 244, 0.22);
    border-color: #4285F4;
    background: #ffffff;
}

.google-auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.google-auth-btn .google-icon-svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.google-auth-btn .google-btn-arrow {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-left: auto;
    transition: transform 0.2s ease, color 0.2s ease;
}

.google-auth-btn:hover .google-btn-arrow {
    transform: translateX(3px);
    color: #4285F4;
}

/* Dark Mode Google Button */
body.dark-mode .google-auth-btn {
    background: #1e293b;
    color: #f8fafc;
    border-color: #334155;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

body.dark-mode .google-auth-btn:hover {
    border-color: #60a5fa;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
    background: #243044;
}

/* Buttons */
.btn {
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
body.dark-mode .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
}
.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.08);
}
body.dark-mode .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-google {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.btn-google img {
    width: 20px;
    height: 20px;
}

.btn-google:hover {
    background: var(--bg-app);
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
}

/* ----------------------------------------------------
   APP WRAPPER LAYOUT
   ---------------------------------------------------- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* 1. Sidebar Design (Left) */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.sidebar-brand {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand .brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.sidebar-brand .brand-name {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.sidebar-brand .brand-name .accent {
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 500;
}

.sidebar-menu {
    flex: 1;
    padding: 0.5rem 1rem;
    overflow-y: auto;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 550;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

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

.nav-link.active {
    background: var(--active-nav-gradient);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(217, 70, 239, 0.2);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.social-contact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.social-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}
body.dark-mode .social-btn {
    background: rgba(255, 255, 255, 0.05);
}
.social-btn:hover {
    background: #0088cc;
    color: #ffffff;
    transform: scale(1.05);
}

.btn-logout {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: var(--danger);
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: var(--danger);
    color: #ffffff;
}

/* 2. Main Content Container (Right) */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-app);
    transition: background-color var(--transition-speed) ease;
}

/* Top Header */
.main-header {
    padding: 2rem 2.5rem 1.5rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-app);
    position: sticky;
    top: 0;
    z-index: 900;
    transition: background-color var(--transition-speed) ease;
}

.header-left h2 {
    font-size: 1.6rem;
    font-weight: 750;
    letter-spacing: -0.5px;
}

.header-left p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.2rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* Action Buttons in Header */
.header-action-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.header-action-btn:hover {
    background: var(--border-color);
}

.header-action-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-card);
}

/* Coins Display */
.coin-wallet-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    padding: 0.6rem 1.15rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 0.95rem;
}

.text-gold {
    color: #fbbf24;
}

.spin-gold {
    animation: goldSpin 6s linear infinite;
}

@keyframes goldSpin {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
    100% { transform: rotateY(360deg); }
}

.btn-theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    padding: 0.6rem 1.15rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-theme-toggle:hover {
    background: var(--border-color);
}

/* 3. Tab Routing Views Container */
.tab-view-container {
    flex: 1;
    padding: 0.5rem 2.5rem 2.5rem 2.5rem;
}

.tab-view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

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

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

/* Content Panel Base Cards */
.content-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    border-radius: 20px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h3 {
    font-size: 1.2rem;
    font-weight: 750;
    letter-spacing: -0.3px;
}

/* ----------------------------------------------------
   DASHBOARD VIEW METRICS
   ---------------------------------------------------- */
.select-wrapper {
    position: relative;
    min-width: 220px;
}

.form-select {
    width: 100%;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    font-size: 0.85rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
}

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

.stat-card {
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform var(--transition-speed) ease;
}

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

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.icon-upload {
    background: rgba(139, 92, 246, 0.08);
    color: #8b5cf6;
}

.icon-download {
    background: rgba(59, 130, 246, 0.08);
    color: #3b82f6;
}

.icon-expiry {
    background: rgba(6, 182, 212, 0.08);
    color: #06b6d4;
}

.icon-status {
    background: rgba(107, 114, 128, 0.08);
    color: var(--text-secondary);
}

.icon-status.active {
    background: var(--success-light);
    color: var(--success);
}
.icon-status.expired {
    background: var(--danger-light);
    color: var(--danger);
}
.icon-status.pending {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-info span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.15rem;
    font-weight: 500;
}

.stat-info h4 {
    font-size: 1.2rem;
    font-weight: 750;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    border-radius: 20px;
    padding: 1.5rem;
}

.card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* Bar Chart */
.bar-chart-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.bar-chart-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 500;
}

.bar-track {
    height: 10px;
    background-color: var(--bg-app);
    border-radius: 5px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 5px;
    width: 0;
    transition: width 1s ease-out;
}

.upload-fill {
    background: var(--primary-gradient);
}

.download-fill {
    background: var(--accent-gradient);
}

/* Circular Gauge */
.gauge-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gauge-card h4 {
    align-self: flex-start;
}

.gauge-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0.5rem 0;
}

.gauge-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.gauge-bg {
    fill: none;
    stroke: var(--bg-app);
    stroke-width: 8;
}

.gauge-progress {
    fill: none;
    stroke: url(#gaugeGradient); /* Fallback to standard color if SVG gradient fails */
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-out;
}

/* SVG gradient hack using dynamic css primary */
body.dark-mode .gauge-progress {
    stroke: var(--secondary);
}

.gauge-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.gauge-text h2 {
    font-size: 1.6rem;
    font-weight: 850;
    letter-spacing: -0.5px;
}

.gauge-text span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.gauge-legend {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 1.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.gauge-legend span i {
    font-size: 0.65rem;
    margin-right: 0.25rem;
}

.gauge-legend strong {
    color: var(--text-primary);
}

/* Connection Status Placeholder Info */
.info-card {
    display: flex;
    flex-direction: column;
}

.connection-status-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Empty States */
.empty-state-card {
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.empty-state-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
}

.empty-state-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
}

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

/* Active Config Info Cards */
.active-config-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.config-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.config-title-group h4 {
    font-size: 1rem;
    font-weight: 700;
}

.config-title-group span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.badge-status {
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-status.active {
    background-color: var(--success-light);
    color: var(--success);
}
.badge-status.expired {
    background-color: var(--danger-light);
    color: var(--danger);
}
.badge-status.pending {
    background-color: var(--warning-light);
    color: var(--warning);
}

.config-details-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    background: var(--bg-app);
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.detail-item span {
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.15rem;
}

.detail-item strong {
    font-weight: 700;
}

.sub-link-input-group {
    display: flex;
    gap: 0.5rem;
}

.sub-link-input {
    flex: 1;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-app);
    font-size: 0.8rem;
    color: var(--text-secondary);
    outline: none;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.btn-sub {
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.btn-sub.primary {
    background: var(--primary-gradient);
    color: #ffffff;
}

.btn-sub.secondary {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
    border-color: var(--border-color);
}
body.dark-mode .btn-sub.secondary {
    background: rgba(255, 255, 255, 0.03);
}

.btn-sub:hover {
    transform: translateY(-1px);
}

/* ----------------------------------------------------
   PACKAGES VIEW LISTING
   ---------------------------------------------------- */
.search-bar {
    position: relative;
    min-width: 250px;
}

.search-bar i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.search-bar input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.25rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.search-bar input:focus {
    border-color: var(--primary);
}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.package-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.package-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
}

/* Package Banner / Ribbons */
.holiday-badge {
    position: absolute;
    top: 15px;
    right: -30px;
    background: linear-gradient(135deg, #a855f7 0%, #db2777 100%);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.25rem 2rem;
    transform: rotate(45deg);
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.limited-badge {
    position: absolute;
    top: 15px;
    right: -30px;
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.25rem 2rem;
    transform: rotate(45deg);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.package-header {
    padding: 1.5rem;
    background: linear-gradient(to bottom, var(--primary-light), transparent);
    border-bottom: 1px solid var(--border-color);
}

.package-header h4 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #3b82f6; /* Airtel Blue / Custom colors */
    margin-bottom: 0.25rem;
    max-width: 80%;
}

.package-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

.package-price span {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.package-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.spec-item i {
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
    color: var(--primary);
}

.promo-tag {
    background: rgba(217, 70, 239, 0.08);
    color: #d946ef;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    align-self: flex-start;
    margin-bottom: 0.25rem;
}

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

.package-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.btn-buy-coins:hover {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.05);
    color: #d97706;
}

/* ----------------------------------------------------
   ORDERS TABLE HISTORY
   ---------------------------------------------------- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.data-table th {
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.01);
}
body.dark-mode .data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.01);
}

.thumbnail-slip {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.thumbnail-slip:hover {
    transform: scale(1.1);
}

/* ----------------------------------------------------
   FREE CONFIGS EXCHANGE GRID
   ---------------------------------------------------- */
.coin-balance-pill {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.5rem 1.15rem;
    border-radius: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.configs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.config-market-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    transition: transform 0.25s ease;
}

.config-market-card:hover {
    transform: translateY(-2px);
}

.network-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(59, 130, 246, 0.08);
    color: #3b82f6;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
}

.config-market-card.locked {
    border-color: rgba(251, 191, 36, 0.3);
}

.config-market-card.unlocked {
    border-color: rgba(16, 185, 129, 0.3);
}

.config-market-card h4 {
    font-size: 1.05rem;
    font-weight: 750;
    margin-right: 4rem; /* Save space for badge */
}

.config-market-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Glassmorphism Lock Overlay for configurations */
.config-lock-overlay {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.lock-icon-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 0.25rem;
}

.btn-unlock-config {
    background: var(--gold-gradient);
    color: #ffffff;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
    transition: all 0.2s ease;
}

.btn-unlock-config:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 15px rgba(217, 119, 6, 0.3);
}

/* ----------------------------------------------------
   SYSTEM MESSAGES & ANNOUNCEMENTS
   ---------------------------------------------------- */
.announcements-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.announcement-item {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    background-color: var(--bg-card);
    transition: transform var(--transition-speed) ease;
}

.announcement-item:hover {
    transform: translateX(4px);
}

.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.announcement-header h4 {
    font-size: 1rem;
    font-weight: 750;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.announcement-item.info h4 {
    color: var(--primary);
}

.announcement-item.warning h4 {
    color: var(--warning);
}

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

.announcement-body p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ----------------------------------------------------
   COMMUNITY POSTS GRID
   ---------------------------------------------------- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.post-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    transition: all var(--transition-speed) ease;
}

.post-card:hover {
    transform: translateY(-2px);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
}

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

.post-card h4 {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.3;
}

.post-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1;
}

.post-link {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    align-self: flex-start;
}

.post-link:hover i {
    transform: translateX(3px);
    transition: transform 0.2s ease;
}

/* ----------------------------------------------------
   ADMIN CONTROL PANEL
   ---------------------------------------------------- */
.admin-nav-link {
    border: 1px dashed rgba(239, 68, 68, 0.3);
}

.admin-nav-link:hover {
    background-color: rgba(239, 68, 68, 0.05) !important;
}

.admin-grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .admin-grid-layout {
        grid-template-columns: 1.2fr 1fr;
    }
}

.admin-section {
    border-color: rgba(239, 68, 68, 0.15);
}

.admin-slips-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 700px;
    overflow-y: auto;
}

.admin-slip-card {
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.slip-user-info h5 {
    font-size: 0.9rem;
    font-weight: 700;
}

.slip-user-info span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.slip-meta-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    background: var(--bg-card);
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.slip-meta-details span {
    color: var(--text-secondary);
}

.slip-meta-details strong {
    font-weight: 700;
    color: var(--primary);
}

/* Form Styles */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    padding: 0.65rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-app);
    font-size: 0.85rem;
    outline: none;
    width: 100%;
}
body.dark-mode .form-control {
    background-color: var(--bg-card);
}
.form-control:focus {
    border-color: var(--primary);
}

textarea.form-control {
    resize: vertical;
}

/* ----------------------------------------------------
   MODAL OVERLAY BACKDROP
   ---------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.25s ease forwards;
}

.modal-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-modal);
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 850;
    letter-spacing: -0.3px;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-muted);
}
.modal-close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.slip-preview-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    object-fit: contain;
    background: #000;
}

.modal-buttons {
    display: flex;
    gap: 0.75rem;
}

/* ----------------------------------------------------
   GLOBAL APP FOOTER
   ---------------------------------------------------- */
.app-footer {
    padding: 2rem 2.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: auto;
}

.app-footer strong {
    color: var(--text-secondary);
}

.designer-tag span {
    font-weight: 700;
}

/* Responsive Overrides */
@media (max-width: 991px) {
    .sidebar {
        width: 80px;
    }
    .sidebar-brand .brand-name,
    .sidebar-menu span,
    .sidebar-footer span {
        display: none;
    }
    .main-content {
        margin-left: 80px;
    }
    .nav-link {
        justify-content: center;
        padding: 0.85rem;
    }
    .nav-link i {
        font-size: 1.25rem;
    }
    .sidebar-footer {
        align-items: center;
    }
}

@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.5rem;
    }
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    .tab-view-container {
        padding: 1rem;
    }
    .app-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem;
    }
}
