/* ==============================
   CSS RESET
   ============================== */
* {
    box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

/* ==============================
   BASE STYLES
   ============================== */
body {
    /* Remove ALL flexbox properties */
    display: block !important;
    flex-direction: unset !important;
    min-height: 100vh;

    /* Spacing for fixed elements */
    padding-top: 2rem;
    padding-bottom: 2rem;
    margin: 0;

    /* Background and other styles */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    position: relative;
    box-sizing: border-box;
    background: linear-gradient(45deg, #DA020E, #000000);
    background-size: 1% 370%;
    animation: redToBlackLoop 12s ease infinite;
}

@keyframes redToBlackLoop {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
    100% {
        background-position: 0% 0%;
    }
}

main {
    flex: 1;
}

main h1 {
    text-align: center;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    /*text-shadow: 0 2px 4px rgba(0,0,0,0.3);*/
    letter-spacing: -0.02em;
    margin: 2rem 0 0;
}

h2 {
    text-align: center;
    color: black;
    font-weight: 600;
    margin: 0 0 1rem;
}

/* ==============================
   CONTENT CONTAINER - CONSOLIDATED
   ============================== */
.content-container {
    flex: 1;
    overflow: visible;
    position: relative;
    z-index: 1; /* Ensure content stays above background */
}

/* Ensure cards and content don't go under footer */
.content-container > * {
    margin-bottom: 0; /* Remove default margins that might cause overlap */
    margin-left: 1rem;
    margin-right: 1rem;
}

/* Add spacing to the last element in content */
.content-container > *:last-child {
    margin-bottom: 20px;
}

/* ==============================
   TABLE STYLES
   ============================== */
.table-container {
    overflow-x: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    background: #EEEEEE;
    margin-left: 1rem;
    margin-right: 1rem;
}

.no-rating {
  background-color: #f5f5f5;
  color: #878787;
}

.ratings-table {
    border-collapse: collapse;
    table-layout: auto; /* fits content */
    min-width: 600px;
    background: white;
    border-radius: 15px;
    width: auto;
}

.ratings-table th,
.ratings-table td {
    border: none;
    border-right: 1px solid #e2e8f0;
    white-space: nowrap;
    padding: 8px;
    text-align: center;
    position: relative;
}

.ratings-table th:last-child,
.ratings-table td:last-child {
    border-right: none;
}

/* Sticky header */
.ratings-table thead th {
    position: sticky;
    top: 0;
    background: #FAFAFA;
    color: rgb(0,0,0);
    z-index: 3;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Sticky first column */
.ratings-table td:first-child,
.ratings-table th:first-child {
    position: sticky;
    left: 0;
    min-width: 160px;
    width: 160px;
    z-index: 100;
    background: #EEEEEE;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ratings-table thead th:first-child {
    z-index: 120;
    background: linear-gradient(135deg, #dfdfee 0%, #3b79ec 100%);
    color: black;
}

.ratings-table tbody td:first-child {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #334155;
    font-weight: 600;
}

.ratings-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.ratings-table tbody tr:nth-child(even) td:first-child {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

.ratings-table tbody tr:hover {
    background-color: #e0e7ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 2px rgba(0,0,0,0.1);
}

.ratings-table tbody tr:hover td:first-child {
    background: linear-gradient(135deg, #eeeeee 0%, #9eb3ee 100%);
}

.ratings-table thead th:not(:first-child),
.ratings-table tbody td.match-end {
    border-right: 2px solid #000000;
}

/* ==============================
   COMPETITION COLORS
   ============================== */
.competition-row th {
    font-weight: 500;
    text-transform: none;
    padding: 0.75rem;
    white-space: normal;
    word-wrap: break-word;
    hyphens: auto;
}

.competition-epl {
    background: linear-gradient(45deg, #04F9FC, #BF1CF0) !important;
    color: black;
}

.competition-fa-cup {
    background: linear-gradient(45deg, #dd16c0, #fd1c59) !important;
    color: black;
}

.competition-carabao-cup {
    background: linear-gradient(45deg, #ceff10, #04f9a5) !important;
    color: black;
}

.competition-default {
    background: linear-gradient(135deg, #dfdfee 0%, #3b79ec 100%) !important;
}

/*===============================
    AVERAGE STATS STYLING
    ================================*/
/* Container that holds all competition cards */
.competition-cards-container {
    padding: 1rem;
    border-radius: 15px;
    background-color: #fff;
    overflow-x: auto;
    position: relative;
    box-sizing: border-box;
    margin-right: 1rem;
    margin-left: 1rem;
}


.main-card-title {
    text-align: center;
}

.main-card-title h2 {
    font-size: 1.5rem;   /* adjust to taste */
    font-weight: bold;
    margin-bottom: 1rem;
}

/* Wrapper for competition cards with gap */
.competition-cards-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

/* Each card */
.competition-card {
    border: 2px solid black;
    border-radius: 5px;
    padding: 1rem;
    display: flex;
    align-items: center;   /* EPL/FA Cup block vertically centered */
    background: #fff;
    margin-top: 1rem;
}

/* Header block (Competition logo / title box) */
.competition-header {
    width: 6rem;
    height: 5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;       /* ✅ prevents resizing */
    text-align: center
}
/* Stats area (Home & Away) */
.stats-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stats-content h4 {
    margin: 0;
    font-size: 1rem;
    text-align:center;
}

.stats-content p {
    margin: 0;
    font-size: 0.9rem;
    text-align:center;
}

/* Fallback when no data */
.no-data {
    margin-left: 1rem;
    font-style: italic;
    color: gray;
}



/* ==============================
   DISABLE TABLE INTERACTIONS
   ============================== */
.ratings-table,
.ratings-table * {
    user-select: none; /* Disable text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none; /* Disable all click/tap events */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
    outline: none; /* Remove focus outlines */
}

/* Remove any cursor changes */
.ratings-table,
.ratings-table th,
.ratings-table td {
    cursor: default !important;
}

/* Override hover effects to remove animations */
.ratings-table tbody tr:hover {
    background-color: #f8fafc; /* Keep same as non-hover */
    transform: none !important; /* Remove transform animation */
    box-shadow: none !important; /* Remove hover shadow */
}

.ratings-table tbody tr:hover td:first-child {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%); /* Same as non-hover */
}

/* For even rows hover */
.ratings-table tbody tr:nth-child(even):hover {
    background-color: #f8fafc; /* Same as even row default */
}

.ratings-table tbody tr:nth-child(even):hover td:first-child {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%); /* Same as even row default */
}

/* ==============================
   SCORE BADGES
   ============================== */
.score-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: bold;
    font-size: 0.95rem;
    color: white;
}

.score-badge.Win { background: #2C5F34; }
.score-badge.Loss { background: #DA2C43; }
.score-badge.Draw { background: #EAA221; }

/* ==============================
   PLAYER MOVEMENTS
   ============================== */
.player-movements {
    margin-top: 1rem;
    padding: 2rem;
    background: white;
    /*backdrop-filter: blur(10px);*/
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-left: 1rem;
    margin-right: 1rem;
}

.player-movements h2,
.player-movements h3 {
    text-align: center;
    font-weight: 700;
    position: relative;
    margin-top: 0;
}

.player-movements h2 {
    color: #1f2937;
    font-size: 1.5rem;
}

.player-movements h3 {
    margin-bottom: 1rem;
    color: #1f2937;
    font-size: 1.2rem;
}

/* Movement cards */
.movement-cards {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.card {
    flex: 1 1 300px;
    border-radius: 15px;
    padding: 1.5rem;
    background: white;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--card-color), var(--card-color-light));
    margin-bottom: 1rem;
}

.card.incoming {
    --card-color: #10b981;
    --card-color-light: #34d399;
    box-shadow: 0 10px 30px rgba(16,185,129,0.2);
}

.card.outgoing {
    --card-color: #ef4444;
    --card-color-light: #f87171;
    box-shadow: 0 10px 30px rgba(239,68,68,0.2);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* Player item in cards */
.player-item {
    display: flex;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 15px;
    transition: all 0.2s ease;
}

.player-item:hover {
    background: #e2e8f0;
    transform: translateX(5px);
}

.player-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.player-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.player-name-age {
    display: flex;
    flex-direction: column;
}

.player-name-age .name {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.player-name-age .age {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

.pos-price {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.pos-price .position {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.pos-price .price {
    font-size: 1rem;
    color: #1f2937;
    font-weight: 700;
}

/* ==================================================
 This sets the background for the "Goals" accordion header
========================================================*/
.goals-stats-item .accordion-header {
    background-color: white;
}
/* ==============================
   ACCORDION
   ============================== */
.accordion-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.accordion-item {
    border: none;
    border-radius: 0.75rem;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.accordion-header {
    cursor: pointer;
    padding: 1rem;
    background-color: #EFBF04;
    color: black;
    font-weight: 600;
    font-size: 1.25rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    border: none;
    transition: background-color 0.3s ease;
}

/*.accordion-header:hover {
    background-color: #C2B067;
}*/

.accordion-header h3 {
    flex: 1;
    text-align: center;
    margin: 0;
}

.accordion-header .fas {
    flex: 0 0 auto;
    margin-left: auto;
}

.accordion-header .fas.rotate-180 {
    transform: rotate(180deg);
}

.accordion-content {
    background-color: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 0 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(.42, .58, .71, .61);
}


.accordion-content.open {
    height: auto;
    padding: 1rem;
}

.accordion-item:nth-of-type(2) .accordion-header {
    background: #82C8E5;
}

/*.accordion-item:nth-of-type(2) .accordion-header:hover {
    background: #829FAB;
}*/

.accordion-item:nth-of-type(2) .accordion-content {
    background-color: #f0fdfa;
}

/* ==============================
   HEADER & FOOTER - ALWAYS VISIBLE
   ============================== */

/* Header - Fixed at top, content scrolls underneath */
.main-header {
    position: fixed; /* Changed from sticky to fixed */
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    background-color: #f8f9fa;
    padding: 0;
    margin: 0;
    z-index: 1001; /* High z-index to stay on top */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.main-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 2rem; /* Increased for better visibility */
    box-sizing: border-box;
}

/* ==============================
   FOOTER
   ============================== */
.main-footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    flex: none !important;
    flex-shrink: unset !important;
    margin-top: 0 !important;
    margin: 0 !important;
    width: 100vw;
    background-color: #f8f9fa;
    padding: 0 !important;
    border-top: 1px solid #dee2e6;
    z-index: 1001;
    display: block !important;
}

/* Match your HTML structure - .footer-content instead of .container */
.main-footer .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 2rem;
    box-sizing: border-box;
}

.main-footer .footer-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
}

/* Navigation link styles */
.main-nav-link {
    color: #4b5563;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
    font-size: 1rem;
}

.main-nav-link:hover {
    color: #3b82f6;
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    .ratings-table th,
    .ratings-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.9rem;
    }
    .ratings-table td:first-child,
    .ratings-table th:first-child {
        width: 150px;
        min-width: 150px;
    }
    .player-movements {
        padding: 1rem;
        /*margin-top: 2rem;*/
    }
    .movement-cards {
        gap: 1rem;
    }
    .card {
        padding: 1rem;
    }
    .player-item {
        gap: 1rem;
        padding: 0.75rem;
    }
    .player-item img {
        width: 60px;
        height: 60px;
    }
    .player-info {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }
    .player-main {
        flex-direction: column;
        gap: 0.5rem;
    }
    .player-name-age,
    .pos-price {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        margin-bottom: 0;
    }
    .pos-price {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .ratings-table th,
    .ratings-table td {
        padding: 0.4rem 0.2rem;
        font-size: 0.8rem;
    }
    .ratings-table td:first-child,
    .ratings-table th:first-child {
        width: 120px;
        min-width: 120px;
    }
    .player-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .pos-price {
        text-align: left;
    }
}

/*============================
    About section
=======================*/
.about-card {
    background-color: #D3D3D3;
    border-radius: 15px;
    padding: 20px 25px;
    max-width: 800px;
    margin: 3rem auto 0 auto; /* Center horizontally with top margin */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* Soft shadow */
    text-align: center; /* Center everything inside */
}

.about-card h2 {
    margin-top: 0;
    font-size: 2rem;
    border-bottom: 2px solid #ccc;
    padding-bottom: 10px;
}

.about-card p {
    font-size: 1rem;
    line-height: 1.6;
    margin: 15px 0;
}

.about-card a {
    color: #007bff;
    text-decoration: none;
}


/* =================
     main wrapper for footer and content fitting
     ===================*/
/* Base layout with sticky footer */

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* Header styling */
.main-header {
  flex-shrink: 0; /* Prevent header from shrinking */
  /* Add your existing header styles here */
}

.footer-content {
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
}

/* ========================
   Ratings symbol bubble styles
   ======================== */
/* Main content container */
.main-content {
    position: relative;
    display: inline-block;
    margin: 1.5rem 0;
}

/* Info button styles - simple clean design */
.info-button {
    align-items: center;
    background: linear-gradient(135deg, #dfdfee 0%, #3b79ec 100%);
    border-radius: 8px;
    border-width: 0;
    box-shadow: 0 10px 20px rgba(0, 0, 0, .1), 0 3px 6px rgba(0, 0, 0, .05);
    box-sizing: border-box;
    color: black;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    font-size: 0.8rem;
    font-weight: 500;
    height: 2rem;
    justify-content: center;
    margin: 0;
    padding: 0 1rem;
    text-align: center;
    transition: all 150ms;
    user-select: none;
    touch-action: manipulation;
    margin-left: 1rem;
}

.info-button:hover {
    box-shadow: rgba(0, 1, 0, .2) 0 2px 8px;
    opacity: .85;
}

.info-button:active {
    outline: 0;
}

.info-button:focus {
    box-shadow: rgba(0, 0, 0, .5) 0 0 0 3px;
}

@media (max-width: 420px) {
    .info-button {
        height: 38px;
        font-size: 12px;
        padding: 0 12px;
    }
}

/* Bubble card styles - same level as button, centered on screen */
.bubble-card {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1), 0 5px 15px rgba(0,0,0,0.08);
    width: 250px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0.6, 0.23, 1.4);
    z-index: 1000;
    border: 1px solid rgba(0,0,0,0.05);
}

.bubble-card.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Ratings guide content styles */
.ratings-guide {
    padding: 0;
}

.ratings-guide h3 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    text-align: center;
}

.ratings-symbols {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.symbol-card {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
}

.symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    font-size: 12px;
    font-weight: bold;
}

.symbol.sub-in {
    color: #28a745;
}

.symbol.sub-out {
    color: #dc3545;
}

.symbol.motm {
    font-size: 14px;
}

/* Overlay to close bubble when clicking outside */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 999;
    display: none;
}

.overlay.active {
    display: block;
}