/* ===================== HOMEPAGE V4 MOBILE STYLES (Bottom Nav Layout) ===================== */
/* 2026-02-08: Responsive (Mobile: Bottom Nav, Desktop: Home New Sidebar) */

.home-v4-scope * {
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .fixnav {
        display: none !important;
    }
}

/* === Layout & Containers === */
.home-v4-container {
    max-width: 100%;
    margin: 0 auto;
    background: #f5f7fa;
    min-height: 80vh;
    padding-bottom: 70px;
    /* Space for bottom nav */
}

/* === Bottom Navigation Bar === */
.v4-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 60px;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    padding-bottom: env(safe-area-inset-bottom);
}

.v4-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.v4-nav-item.active {
    color: #10b981;
}

.v4-nav-icon {
    font-size: 22px;
    margin-bottom: 2px;
    line-height: 1;
}

.v4-nav-lbl {
    font-size: 10px;
    font-weight: 500;
}

/* === Desktop Sidebar (Default Hidden on Mobile) === */
.v4-desktop-sidebar-content {
    display: none;
}

/* === Content Panels === */
.v4-content-panel {
    display: none;
    padding: 15px 0;
    animation: fadeIn 0.2s ease-out;
}

.v4-content-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   TAB 1: MATCH LIST 
   ========================================= */
.panel-matches {
    padding-top: 10px;
}

/* Disclaimer & Notification (New Header) */
.site-disclaimer {
    text-align: center;
    padding: 12px 16px;
    background: #fff1f0;
    color: #cf1322;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    margin: 0 12px 15px 12px;
    border: 1px solid #ffccc7;
    line-height: 1.6;
    box-shadow: 0 1px 3px rgba(207, 19, 34, 0.05);
}

.v4-notification-banner {
    margin: 0 12px 15px 12px;
    background: #fff8e6;
    border: 1px solid #ffe58f;
    padding: 12px 16px;
    border-radius: 8px;
    color: #d46b08;
    font-size: 14px;
}

@media (max-width: 768px) {
    .site-disclaimer {
        padding: 8px 10px;
        font-size: 12px;
        margin-bottom: 10px;
        line-height: 1.4;
    }

    .v4-notification-banner {
        margin-bottom: 10px;
        padding: 6px 10px;
        font-size: 12px;
    }
}

.v4-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px 12px 15px;
}

.v4-date {
    font-weight: 700;
    color: #111;
    font-size: 15px;
}

.v4-filter-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
}

/* =========================================
   MATCH CARD STYLES (Ported from Home New)
   ========================================= */
.match-card {
    display: block;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin: 0 12px 15px 12px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: all 0.2s;
}

.match-card:hover {
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
    transform: translateY(-2px);
}

/* -- Card Header -- */
.mc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}

.mc-meta {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mc-meta .date {
    font-weight: 700;
    color: #111;
    font-size: 14px;
}

.mc-meta .league {
    background: #eff6ff;
    color: #2563eb;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
}

.mc-meta .num {
    color: #4b5563;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.mc-meta .time {
    font-weight: 700;
    color: #111;
}

.mc-status {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    /* Prevent status from shrinking */
}

.mc-conf {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

.mc-conf.high {
    background: #dc2626;
}

.mc-conf.medium {
    background: #f59e0b;
}

.mc-conf.low {
    background: #3b82f6;
}

.mc-conf.danger {
    background: #333333;
}

/* -- Card Body -- */
.mc-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mc-teams {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    /* Exact match to Home New */
}

.mc-team {
    width: 100px;
    /* Exact match to Home New */
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.mc-team img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.mc-team span {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    max-width: 100px;
}

.mc-score {
    text-align: center;
    min-width: 80px;
}

.mc-score .main {
    font-size: 28px;
    font-weight: 800;
    color: #111;
    line-height: 1;
}

.mc-score .sub {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.mc-score .vs {
    font-size: 20px;
    font-weight: 700;
    color: #d1d5db;
}

/* -- V4 Tags (Text Labels) -- */
.mc-tags {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.mc-tag {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    background: #f3f4f6;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.mc-tag.hit {
    background: #fff1f0;
    color: #f56c6c;
    border: 1px solid #ffccc7;
    /* Red border for hit */
    font-weight: 600;
}

/* Fix Stamp Overlap - Match Home New exactly */
.mc-status .prediction-stamp,
.prediction-stamp {
    position: static !important;
    width: 22px !important;
    height: 22px !important;
    font-size: 12px !important;
    line-height: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    transform: none !important;
    border-width: 1px !important;
    border-radius: 50%;
    flex-shrink: 0;
}

.stamp-red {
    color: #dc2626 !important;
    border: 1px solid #dc2626 !important;
    background: #fff1f2 !important;
}

.stamp-black {
    color: #374151 !important;
    border: 1px solid #374151 !important;
    background: #f3f4f6 !important;
}

/* -- Card Footer (Highlight) -- */
.mc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f9fafb;
    border-top: 1px solid #f3f4f6;
    margin: 0 -15px -15px -15px;
    /* Pull to edges inside .mc-body padding */
    font-size: 12px;
    color: #6b7280;
}

.mc-footer-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    overflow: hidden;
}

.mc-highlight-icon {
    font-size: 14px;
}

.mc-highlight-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mc-footer-right {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    margin-left: 10px;
}

.update-pulse {
    width: 6px;
    height: 6px;
    background: #f59e0b;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 4px rgba(245, 158, 11, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

/* Prediction Stamp (Red Check / Black Cross) */
.prediction-stamp {
    font-size: 18px;
    font-weight: bold;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-left: 8px;
}

.stamp-red {
    color: #dc2626;
    border: 2px solid #dc2626;
    background: #fff1f2;
}

.stamp-black {
    color: #374151;
    border: 2px solid #374151;
    background: #f3f4f6;
    font-size: 14px;
    /* Cross slightly smaller */
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .match-card {
        margin: 0 10px 12px 10px;
    }

    .mc-header {
        padding: 8px 12px;
    }

    .mc-body {
        padding: 12px;
        gap: 10px;
    }

    .mc-meta .date {
        display: block;
    }

    /* Show date */

    .mc-team img {
        width: 40px;
        height: 40px;
    }

    .mc-team span {
        font-size: 12px;
        max-width: 80px;
    }

    .mc-score .main {
        font-size: 24px;
    }

    .mc-score .vs {
        font-size: 18px;
    }

    .mc-tags {
        gap: 6px;
        flex-wrap: wrap;
    }

    .mc-tag {
        font-size: 10px;
        padding: 3px 8px;
    }

    .mc-footer {
        padding: 8px 12px;
        margin: 0 -12px -12px -12px;
    }
}

.mc-tag {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    background: #f3f4f6;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.mc-tag.hit {
    background: #fff1f2;
    color: #e11d48;
    border: 1px solid #fecdd3;
}

/* Filter Panel */
.filter-panel {
    background: #fff;
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
    display: none;
}

.filter-panel.active {
    display: block;
}

.fp-row {
    display: flex;
    margin-bottom: 10px;
}

.fp-label {
    width: 50px;
    font-weight: bold;
    font-size: 13px;
    padding-top: 4px;
}

.fp-options {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fp-opt {
    padding: 3px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.fp-opt.active {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

/* Functions Grid (Mobile Only) */
.v4-func-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px 5px;
    padding: 20px 10px;
    background: #fff;
    margin: 12px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.v4-func-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
}

.v4-fi-icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: transform 0.1s;
}

.v4-fi-lbl {
    font-size: 12px;
    color: #374151;
    font-weight: 500;
}


/* === SIDEBAR STYLES (Copied from home-new.css) === */
.checkin-card {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%);
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: transform 0.2s;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

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

.checkin-info h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.checkin-info p {
    margin: 4px 0 0 0;
    font-size: 13px;
    opacity: 0.9;
    color: #fff;
}

.checkin-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Ranking Cards */
.ranking-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    margin-bottom: 50px;
}

.right-sidebar-new>.ranking-card:not(:last-child) {
    margin-bottom: 50px !important;
}

.ranking-card .card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.ranking-list {
    padding: 8px 0;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    gap: 12px;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
}

.ranking-item:hover {
    background: #f9fafb;
}

.rank-index {
    width: 20px;
    font-size: 14px;
    font-weight: 700;
    color: #9ca3af;
    text-align: center;
}

.ranking-item:nth-child(1) .rank-index {
    color: #fbbf24;
}

.ranking-item:nth-child(2) .rank-index {
    color: #94a3b8;
}

.ranking-item:nth-child(3) .rank-index {
    color: #b45309;
}

.rank-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.rank-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-bar-wrap {
    width: 60px;
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
}

.rank-bar {
    height: 100%;
    background: #10b981;
    border-radius: 3px;
}

.rank-acc {
    width: 45px;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    text-align: right;
}




/* Match Card Footer (Highlight - Home New Style) */
.mc-footer {
    padding: 12px 16px;
    background: #f9fafb;
    border-top: 1px dashed #e5e7eb;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    /* Ensure spacing from content */
}

.mc-footer-left {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    align-items: center;
    /* Vertical Center */
    gap: 6px;
}

.mc-highlight-icon {
    font-size: 14px;
    line-height: 1;
    /* Reset line-height */
    display: inline-flex;
    align-items: center;
}

.mc-highlight-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    line-height: normal;
    /* Reset line-height */
    padding-top: 1px;
    /* Optical adjustment */
}

.mc-footer-right {
    color: #f59e0b;
    font-weight: 600;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    background: #fffbef;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #fef3c7;
}

.update-pulse {
    width: 6px;
    height: 6px;
    background-color: #f59e0b;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-orange 1.5s infinite;
}

@keyframes pulse-orange {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 4px rgba(245, 158, 11, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

/* === Desktop Responsive Overrides === */
@media (min-width: 769px) {

    /* 1. Layout Structure */
    .home-v4-container {
        display: grid;
        grid-template-columns: 1fr 360px;
        /* Match Home New */
        gap: 30px;
        max-width: 1200px;
        margin: 20px auto;
        padding-bottom: 20px;
        min-height: auto;
    }

    /* 2. Hide Mobile Elements (Includes Disclaimer for Desktop if desired, but we keep it here for now or hide if redundant) */
    /* Check Home New: Disclaimer is visible on desktop. We keep it. */
    .v4-bottom-nav {
        display: none !important;
    }

    .panel-funcs {
        display: none !important;
    }

    /* 3. Main Col Adjustments */
    .v4-main-col {
        grid-column: 1 / 2;
    }

    .panel-matches {
        display: block !important;
        padding-top: 0;
    }

    /* Hide Mobile Header Elements on Desktop if they duplicate or look bad? 
       Home New keeps disclaimer main col. */

    .match-card {
        margin: 0 0 20px 0;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    }

    /* 4. Desktop Sidebar */
    .v4-desktop-sidebar-content {
        display: block;
        grid-column: 2 / 3;
    }
}