/**
 * GlowSuite Premium UI - Ultra Modern Design System
 * Focus: Rich Aesthetics, Glassmorphism, and Fluid Transitions.
 */

:root {
    --glass-bg: #ffffff; /* Transform to solid white */
    --glass-border: #e2e8f0;
    --premium-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --premium-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --card-radius: 20px;
}

/* Background & Global Polish */
body.admin-layout {
    background: #f8fafc !important; /* Cleaner solid background */
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
}

/* Sidebar Styling - Solid & High Contrast */
.admin-sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
    box-shadow: 10px 0 30px rgba(0,0,0,0.02) !important;
}

.admin-sidebar .nav-link {
    border-radius: 12px !important;
    margin: 4px 16px !important;
    padding: 12px 16px !important;
    color: #475569 !important;
    transition: all 0.2s ease !important;
}

.admin-sidebar .nav-link:hover {
    background: #f1f5f9 !important;
    color: var(--primary-color) !important;
}

.admin-sidebar .nav-link.active {
    background: #f1f5f9 !important; /* Tenuous Gray for Active */
    color: var(--primary-color) !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: none !important;
}

/* FINAL PREMIUM POLISH */
body.admin-layout {
    background-color: #f8fafc !important;
    color: #1e293b !important;
}

.card {
    border-radius: 16px !important;
    border: 1px solid rgba(0,0,0,0.05) !important;
    background: #ffffff !important;
}

/* Sidebar - Modern & Crisp */
.admin-sidebar {
    background: #ffffff !important;
    border-right: 1px solid #f1f5f9 !important;
}

.admin-sidebar .nav-link {
    font-weight: 500 !important;
    font-size: 13.5px !important;
    color: #475569 !important;
}

.admin-sidebar .nav-link.active {
    background-color: #f1f5f9 !important;
    color: #6366f1 !important;
}

/* Typography for Premium feel */
h1, .h1, h2, .h2, h3, .h3 {
    font-weight: 800 !important;
    letter-spacing: -0.04em !important;
    color: #0f172a !important;
}

/* Tables - Ultra Clean */
.table {
    --bs-table-bg: #ffffff !important;
}

.table thead th {
    background-color: #f8fafc !important;
    border-bottom: 2px solid #f1f5f9 !important;
    color: #475569 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}

/* Fix any remaining "Negro" elements */
[class*="bg-dark"], [class*="table-dark"], .alert-dark {
    background-color: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #e2e8f0 !important;
}

/* Header Polish */
.admin-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 0.8rem 2rem !important;
}

/* Premium Cards - SOLID */
.card {
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    border-radius: var(--card-radius) !important;
    box-shadow: var(--premium-shadow) !important;
    transition: all 0.3s ease !important;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02) !important;
}

/* Dashboard Stat Icons - REDESIGNED FOR PREMIUM LOOK */
.dashboard-hero-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 18px !important;
    width: 60px !important;
    height: 60px !important;
    flex-shrink: 0 !important;
}

.dashboard-hero-icon i, .dashboard-hero-icon svg {
    display: block !important;
    line-height: 1 !important;
    font-size: 28px !important;
    width: 28px !important;
    height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #ffffff !important;
}

.dashboard-hero-icon svg path,
.dashboard-hero-icon svg polygon,
.dashboard-hero-icon svg rect,
.dashboard-hero-icon svg circle,
.dashboard-hero-icon svg g {
    fill: #ffffff !important;
}

/* Perfect Vertical Centering in Stats */
.card-body.d-flex.align-items-center {
    min-height: 100px !important; /* Ensure enough room to see centering */
}

/* Color Variants for Stat Containers */
.icon-container-primary { background: rgba(99, 102, 241, 0.1) !important; color: #6366f1 !important; }
.icon-container-success { background: rgba(16, 185, 129, 0.1) !important; color: #10b981 !important; }
.icon-container-warning { background: rgba(245, 158, 11, 0.1) !important; color: #f59e0b !important; }
.icon-container-info { background: rgba(59, 130, 246, 0.1) !important; color: #3b82f6 !important; }

/* Stat Typography Boost */
.stat-value {
    font-size: 24px !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
    line-height: 1 !important;
}

.stat-label {
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    font-weight: 700 !important;
    color: #64748b !important;
    margin-bottom: 6px !important;
}

/* Typography Enhancements */
h1, .h3, h5, .h5 {
    letter-spacing: -0.025em !important;
    color: #1e293b !important;
    font-weight: 700 !important;
}

/* Advanced Buttons */
.btn-primary {
    background: var(--premium-gradient) !important;
    border: none !important;
    padding: 10px 24px !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2) !important;
    transition: all 0.3s ease !important;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3) !important;
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4) !important;
}

/* Premium Table Style V2 - Solid Block with Colored Header */
.table-responsive {
    border-radius: 20px !important;
    overflow-x: auto !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05) !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

.table {
    border-collapse: collapse !important; 
    margin-top: 0 !important;
    border: none !important;
    width: 100%;
}

/* NUCLEAR PREMIUM OVERHAUL V2 */
.table thead th {
    background-color: #6366f1 !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 400 !important; /* Truly light weight - Forced */
    padding: 20px 24px !important;
    border: none !important;
    text-transform: none !important;
    letter-spacing: 0px !important;
}

.table tbody tr:hover {
    background-color: #f8fafc !important;
}

.table tbody td {
    padding: 16px 24px !important;
    color: #1e293b !important;
    font-size: 14px !important;
    border: none !important;
    vertical-align: middle !important;
}

/* HIGH-END PILLS - Matches Primary Button Exactly */
.badge-premium {
    padding: 6px 16px !important;
    font-weight: 700 !important;
    border-radius: 50px !important; 
    font-size: 12px !important;
    text-transform: lowercase !important;
    display: inline-block !important; /* Required for ::first-letter to work reliably */
    background: var(--premium-gradient) !important; 
    color: #ffffff !important; 
    border: none !important;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2) !important;
    line-height: 1.4 !important;
}

.badge-premium::first-letter {
    text-transform: uppercase !important;
}

/* Override variants to keep them all matching the premium theme if needed, 
   but user asked for button color specifically */
.pill-free, .pill-pro, .pill-enterprise, .pill-active {
    background: var(--premium-gradient) !important;
    color: #ffffff !important;
}

/* SOPHISTICATED ACTION ICONS - Updated for better alignment and flexibility */
.btn-premium-action {
    background: #ffffff !important;
    color: #64748b !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    min-width: 42px !important;
    height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    padding: 0 12px !important; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05) !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    margin: 0 !important;
}

/* For icon-only buttons, keep them square/circle */
.btn-premium-action:not(.w-auto) {
    width: 42px !important;
    padding: 0 !important;
}

.btn-premium-action i { 
    font-size: 18px !important; 
    line-height: 1 !important;
    display: inline-block !important;
}

.btn-premium-action:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1) !important;
}

.btn-premium-action.text-primary:hover { color: #6366f1 !important; border-color: #6366f1 !important; background: #eef2ff !important; }
.btn-premium-action.text-info:hover { color: #0ea5e9 !important; border-color: #0ea5e9 !important; background: #f0f9ff !important; }
.btn-premium-action.text-danger:hover { color: #ef4444 !important; border-color: #ef4444 !important; background: #fef2f2 !important; }

/* Premium Form Controls */
.form-control, .form-select {
    border: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    font-size: 13px !important;
    transition: all 0.2s ease !important;
    color: #1e293b !important;
}

.form-control:focus, .form-select:focus {
    background: #ffffff !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1) !important;
    outline: none !important;
}

.form-label {
    font-weight: 600 !important;
    color: #475569 !important;
    margin-bottom: 8px !important;
    font-size: 12px !important;
}

/* Hide ugly default scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* FORCED LIGHT THEME REINFORCEMENTS & DARK MODE NEUTRALIZATION */
.table thead.bg-light, .table thead, .table-header {
    background-color: #f8fafc !important;
}

/* HIGH CONTRAST VISIBILITY FIXES */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: #1e293b !important; /* Force deep slate for all headers */
    opacity: 1 !important;
}

.table thead th {
    color: #334155 !important; /* Even darker for table headers */
    font-weight: 800 !important;
    background-color: #f8fafc !important;
}

.text-muted {
    color: #475569 !important; /* Darker than normal muted for accessibility */
}

/* Fix for specific dashboard table title visibility */
.card-header h6, .card-body h6 {
    color: #0f172a !important;
    font-weight: 800 !important;
}

/* Force all table rows to be solid white and remove any stripes/dark colors */
.table tbody tr, .table-striped tbody tr:nth-of-type(odd), .table-hover tbody tr:hover {
    background-color: #ffffff !important;
    color: #1e293b !important;
}

.table td {
    border-color: #f1f5f9 !important;
    color: #334155 !important;
    font-size: 13.5px !important;
}

/* Fix for specific dark alerts and boxes found in screenshots */
.alert-dark, .bg-dark, .text-bg-dark, [data-bs-theme="dark"] {
    background-color: #f8fafc !important;
    color: #1e293b !important;
    border: 1px solid #e2e8f0 !important;
}

/* Improve Link and Action visibility */
.btn-link, a {
    font-weight: 600 !important;
}

/* Ensure text-muted is still readable */
.text-muted {
    color: #64748b !important; /* Slate 500 - much more readable than defaults */
    opacity: 1 !important;
}

small, .small {
    font-weight: 500 !important;
}

/* Modern shadows for cards to replace dark backgrounds */
.card {
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
}

/* Sidebar contrast fix */
.admin-sidebar .nav-link small {
    color: #475569 !important;
    font-weight: 600 !important;
    letter-spacing: 0.2px !important;
}

/* Focus state for inputs - making them pop more */
.form-control:focus {
    border-color: #6366f1 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.08) !important;
}
/* --- PREMIUM DYNAMIC CARDS (ULTRA CLEAN) --- */
.admin-main .card.card-stat-premium {
    border: none !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    position: relative !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    min-height: 160px !important; /* Less height */
    box-shadow: 0 4px 10px rgba(0,0,0,0.02) !important;
}

.admin-main .card.card-stat-premium:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 15px 30px rgba(0,0,0,0.06) !important;
}

/* Color Variants - High Specificity */
.admin-main .card.card-stat-premium.card-stat-blue { background-color: #e0f2fe !important; color: #0369a1 !important; }
.admin-main .card.card-stat-premium.card-stat-purple { background-color: #f3e8ff !important; color: #7e22ce !important; }
.admin-main .card.card-stat-premium.card-stat-gold { background-color: #fef3c7 !important; color: #a16207 !important; }
.admin-main .card.card-stat-premium.card-stat-rose { background-color: #fee2e2 !important; color: #be123c !important; }

/* Pure Icons - No background box */
.stat-premium-icon {
    width: 32px !important;
    height: 32px !important;
    background: transparent !important; /* Removed white box */
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important; /* Aligned left */
    margin-bottom: 1rem !important;
    box-shadow: none !important;
}

.stat-premium-icon svg, .stat-premium-icon i {
    width: 32px !important; /* Larger pure icon */
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    display: block !important;
}

/* Growth Pill - More subtle */
.stat-growth-pill {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 800;
    background: rgba(255,255,255,0.5) !important;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Typography Boost - REFINED */
.stat-premium-label {
    font-size: 13.5px !important; /* Slightly smaller for elegance */
    font-weight: 700 !important;
    text-transform: none !important;
    letter-spacing: 0px !important;
    margin-bottom: 2px !important;
    opacity: 0.75;
}

.stat-premium-value {
    font-size: 24px !important; /* Slightly smaller for better balance */
    font-weight: 900 !important; /* Maximum thickness now that fonts are loaded */
    letter-spacing: -0.8px !important;
    margin-bottom: 0 !important;
}

/* Sparklines - Refine Colors */
.stat-sparkline {
    position: absolute;
    bottom: -5px;
    left: -5px;
    right: -5px;
    height: 70px;
    pointer-events: none;
    z-index: 1;
}

.stat-sparkline svg {
    width: calc(100% + 10px);
    height: 100%;
}

.stat-sparkline path {
    stroke-width: 3.5 !important;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.card-stat-blue .stat-sparkline path { stroke: #0ea5e9 !important; }
.card-stat-purple .stat-sparkline path { stroke: #a855f7 !important; }
.card-stat-gold .stat-sparkline path { stroke: #f59e0b !important; }
.card-stat-rose .stat-sparkline path { stroke: #f43f5e !important; }

.stat-sparkline path.area {
    stroke: none !important;
    opacity: 0.15 !important;
}

.card-stat-blue .stat-sparkline path.area { fill: #0ea5e9 !important; }
.card-stat-purple .stat-sparkline path.area { fill: #a855f7 !important; }
.card-stat-gold .stat-sparkline path.area { fill: #f59e0b !important; }
.card-stat-rose .stat-sparkline path.area { fill: #f43f5e !important; }

/* --- ACTIVITY TIMELINE STYLE (Scoped to stat-timeline to avoid conflicts) --- */
.stat-timeline {
    position: relative;
    padding-left: 35px;
    margin-top: 10px;
}

.stat-timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 5px;
    bottom: 5px;
    width: 2px !important;
    background: #e2e8f0 !important;
    border-radius: 10px;
    display: block !important;
}

.stat-timeline-item {
    position: relative;
    padding-bottom: 25px;
    display: block !important;
}

.stat-timeline-item:last-child {
    padding-bottom: 0;
}

.stat-timeline-dot {
    position: absolute;
    left: -35px;
    top: 0;
    width: 26px !important;
    height: 26px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2;
    box-shadow: 0 0 0 4px #fff;
}

.stat-timeline-dot i {
    font-size: 11px !important;
    color: white !important;
}

.stat-timeline-content {
    background: transparent !important;
    padding: 0 !important;
}

.stat-timeline-time {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 600;
}

.stat-timeline-action {
    color: #cbd5e1;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.stat-timeline-action:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* Pulsing Dot Effect */
.stat-dot-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid;
    border-radius: 50%;
    animation: stat-pulse-dot 2s infinite;
    z-index: -1;
}

@keyframes stat-pulse-dot {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

.stat-timeline-item:hover .activity-feed-title strong {
    text-decoration: underline;
}

/* --- RESPONSIVE TABLE OPTIMIZATION --- */
.table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.table.text-nowrap th, 
.table.text-nowrap td {
    white-space: nowrap !important;
}

/* Ensure horizontal scrollbar is visible when needed on mobile */
@media (max-width: 768px) {
    .table-responsive {
        margin-bottom: 1rem;
        padding-bottom: 5px;
    }
}
