/* frontend/assets/css/dashboard/dashboard.css */

:root {
    /* --- Professional Palette --- */
    --bg-body: #F8FAFC;
    /* Slate-50 */
    --bg-card: #FFFFFF;

    --text-primary: #1E293B;
    /* Slate-800 */
    --text-secondary: #64748B;
    /* Slate-500 */
    --text-light: #94A3B8;
    /* Slate-400 */

    --border-color: #E2E8F0;
    /* Slate-200 */
    --primary-brand: #6366F1;
    /* Indigo-500 */
    --primary-hover: #4F46E5;
    /* Indigo-600 */

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
}

/* --- Layout --- */
.content-wrapper {
    padding: 32px 40px;
    max-width: 1600px;
    margin: 0 auto;
}

/* --- Top Bar --- */
.top-bar {
    height: 72px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 99;
    box-shadow: var(--shadow-sm);
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Search Wrapper */
.search-wrapper {
    position: relative;
    width: 320px;
}

.search-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 18px;
}

.search-wrapper input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    background: var(--bg-body);
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.search-wrapper input:focus {
    background: #fff;
    border-color: var(--primary-brand);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* User & Notify */
.notification-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
    position: relative;
    padding: 4px;
    transition: color 0.2s;
}

.notification-btn:hover {
    color: var(--primary-brand);
}

/* --- Header Social Buttons --- */
.btn-header-fb {
    background: #1877F2;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    font-size: 14px;
}

.btn-header-fb:hover {
    background: #145dbf;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

.btn-header-yt {
    background: #FF0000;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    font-size: 14px;
}

.btn-header-yt:hover {
    background: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.notification-btn .dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: #EF4444;
    /* Red */
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.2s;
}

.user-profile:hover {
    background: var(--bg-body);
}

.user-info {
    text-align: right;
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary-brand), #818CF8);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.2);
}

/* --- Welcome Header --- */
.welcome-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 36px;
}

.welcome-text h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.welcome-text p {
    color: var(--text-secondary);
    font-size: 15px;
}

.btn-primary {
    background: var(--primary-brand);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.35);
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 36px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(99, 102, 241, 0.2);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

/* Icon Colors */
.icon-blue {
    background: #EFF6FF;
    color: #3B82F6;
}

.icon-purple {
    background: #EEF2FF;
    color: #6366F1;
}

.icon-green {
    background: #ECFDF5;
    color: #10B981;
}

.icon-orange {
    background: #FFF7ED;
    color: #F97316;
}

.stat-details h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Dashboard Split View --- */
.dashboard-split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    /* Left (Matches) bada, Right (FB Card) chota */
    gap: 24px;
    align-items: start;
    /* Taake stretch na ho */
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

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

.card-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.view-all {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-brand);
    text-decoration: none;
    transition: color 0.2s;
}

.view-all:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Table Styles */
.table-container {
    padding: 0;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table th {
    text-align: left;
    padding: 16px 24px;
    background: #F8FAFC;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.modern-table td {
    padding: 18px 24px;
    border-bottom: 1px solid #F1F5F9;
    font-size: 14px;
    vertical-align: middle;
}

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

.modern-table tr:hover td {
    background-color: #FAFAFA;
}

.match-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.teams {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.tourney {
    font-size: 12px;
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-light);
}

.action-link {
    color: var(--primary-brand);
    font-weight: 600;
    text-decoration: none;
}

.action-link:hover {
    text-decoration: underline;
}

/* Status Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-live {
    background: #FEF2F2;
    color: #EF4444;
    border: 1px solid #FECACA;
}

.status-finished {
    background: #F0FDF4;
    color: #16A34A;
    border: 1px solid #BBF7D0;
}

.status-pending {
    background: #F1F5F9;
    color: #64748B;
    border: 1px solid #E2E8F0;
}

/* Empty State */
.empty-state {
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.empty-icon-bg {
    width: 60px;
    height: 60px;
    background: #F1F5F9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--text-light);
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg, #E2E8F0 25%, #CBD5E1 50%, #E2E8F0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    color: transparent !important;
    border-radius: 6px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* --- FACEBOOK CARD (New Professional Design) --- */
.fb-card {
    background: linear-gradient(135deg, #1877f2 0%, #0c5dc7 100%);
    /* Facebook Blue */
    border-radius: 16px;
    padding: 24px;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: fit-content;
    /* Adjust height based on content */
}

.fb-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(24, 119, 242, 0.3);
}

/* Background Icon Effect */
.fb-card::before {
    content: "\eb91";
    /* RemixIcon Facebook Code */
    font-family: 'remixicon';
    position: absolute;
    top: -20px;
    right: -30px;
    font-size: 180px;
    opacity: 0.1;
    color: white;
    transform: rotate(15deg);
    pointer-events: none;
}

.fb-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    opacity: 0.9;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 2;
}

.fb-card-header i {
    font-size: 20px;
}

.fb-card-body {
    position: relative;
    z-index: 2;
}

.fb-card-body h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 800;
    color: white;
    line-height: 1.2;
}

.fb-card-body p {
    margin: 0 0 25px 0;
    font-size: 15px;
    opacity: 0.9;
    line-height: 1.6;
}

.btn-fb-follow {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: white;
    color: #1877f2;
    padding: 14px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-fb-follow:hover {
    background: #f0f2f5;
    gap: 15px;
    /* Arrow slide animation */
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-split {
        grid-template-columns: 1fr;
    }

    .search-wrapper {
        display: none;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 20px;
    }

    .top-bar {
        padding: 0 20px;
        height: 64px;
    }

    .welcome-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* ✅ Fix Table on Mobile */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
        /* Scrollbar space */
    }

    .modern-table {
        min-width: 600px;
        /* Force min width to trigger scroll */
    }

    .modern-table th,
    .modern-table td {
        white-space: nowrap;
        /* Prevent ugly wrapping */
    }

    /* Ensure FB Card is visible and has spacing */
    .fb-card {
        order: -1;
        /* Move to top */
        margin-top: 0;
        margin-bottom: 24px;
        min-height: auto;
        /* Allow auto height */
    }

    /* Header Icons Only */
    .btn-text {
        display: none;
    }

    .btn-header-fb,
    .btn-header-yt {
        padding: 8px 12px;
        font-size: 20px;
        gap: 0;
    }

    .top-bar-right {
        gap: 12px;
    }
}