body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background-color: #faf9f6; /* Light mode background */
    color: #262626; /* Light mode text */
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.dark-mode {
    background-color: #262626; /* Dark mode background */
    color: #faf9f6; /* Dark mode text */
}

.fpl-primary-color-text {
    color: #262626; /* Dark text for light mode */
    transition: color 0.3s ease;
}

body.dark-mode .fpl-primary-color-text {
    color: #faf9f6; /* Light text for dark mode */
}

:root {
    --p-text-color: #262626; /* Default light mode text color for p tag */
    /* Card / theme variables used by JS-created modals and components */
    --card-bg: #faf9f6;
    --card-text: #262626;
    --card-border: #262626;
    --muted: #666;
}

body.dark-mode {
    --p-text-color: #faf9f6; /* Dark mode text color for p tag */
    /* Dark mode overrides for JS components */
    --card-bg: #262626;
    --card-text: #faf9f6;
    --card-border: #faf9f6;
    --muted: #ccc;
}

p {
    color: var(--p-text-color);
    transition: color 0.3s ease;
}

.dashboard-container {
    max-width: 1600px;

    padding: 20px;
    background-color: #faf9f6; /* Light mode container background */
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(38, 38, 38, 0.1);
    flex-grow: 1;
}

body.dark-mode .dashboard-container {
    background-color: #262626; /* Dark mode container background */
    box-shadow: 0 2px 10px rgba(38, 38, 38, 0.3);
}

.dashboard-header {
    background-color: #faf9f6;
    padding: 10px 0;
    border-bottom: 1px solid #262626;
}

body.dark-mode .dashboard-header {
    background-color: #262626;
    border-bottom: 1px solid #faf9f6;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    width: 90%;
    margin: 0 auto;
}

.header-title {
    display: flex;
    align-items: center;
    font-family: "Archivo Black", sans-serif!important;
}

.header-logo {
    height: 40px;
    margin-right: 15px;
}

.logo-dark {
    display: none;
}

body.dark-mode .logo-light {
    display: none;
}

body.dark-mode .logo-dark {
    display: block;
}

.dashboard-header h1 {
    margin: 0;
    color: #262626; /* Dark text for light mode */
    font-size: 1.5em;
}

body.dark-mode .dashboard-header h1 {
    color: #faf9f6; /* Light text for dark mode */
}

.menu-container {
    position: relative;
    display: inline-block;
}

.menu-toggle-button {
    background-color: #262626;
    color: #faf9f6;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

body.dark-mode .menu-toggle-button {
    background-color: #faf9f6;
    color: #262626;
}

.menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    background-color: #f9f9f9;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000;
}

.menu-dropdown a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.menu-dropdown a:hover {background-color: #f1f1f1}

body.dark-mode .menu-dropdown {
    background-color: #424242;
}

body.dark-mode .menu-dropdown a {
    color: #faf9f6;
}

body.dark-mode .menu-dropdown a:hover {
    background-color: #555;
}

#theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-text {
    font-size: 0.9em;
}

.dashboard-main {
    position: relative; /* For positioning the loader */
    min-height: 200px; /* Ensure some height for content */
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1600px) {
    .dashboard-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Card Colors */


.card {
    background-color: #faf9f6; /* Neutral light mode card background */
    border: 1px solid #262626;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 5px rgba(38, 38, 38, 0.05);
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    color: #262626; /* Default text color for cards */
}
.full-width-card {
    grid-column: 1 / -1; /* For grid layouts */
    flex: 1 1 100%; /* For flex layouts */
    max-width: 100%;
}

body.dark-mode .card {
    background-color: #262626; /* Neutral dark mode card background */
    border-color: #faf9f6;
    box-shadow: 0 1px 5px rgba(38, 38, 38, 0.2);
    color: #faf9f6; /* Text color for cards in dark mode - ensure contrast */
}

.card-header {
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #262626; /* Card header color - ensure contrast with card background */
}

body.dark-mode .card-header {
    color: #faf9f6; /* Card header color in dark mode */
}

.card-subheader {
    font-size: 0.8em;
    color: #6c757d;
    font-weight: 400;
}

.card-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.card-body li {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px dashed rgba(38, 38, 38, 0.1); /* Adjusted for new palette */
}

body.dark-mode .card-body li {
    border-bottom: 1px dashed rgba(250, 249, 246, 0.1); /* Adjusted for new palette */
}

.card-body li:last-child {
    border-bottom: none;
}

.error-message {
    color: #262626;
    background-color: #faf9f6;
    border: 1px solid #262626;
    padding: 10px;
    border-radius: 5px;
    margin-top: 20px;
    display: none;
}

/* New Loader Styles */
.loading-spinner {
    border: 8px solid #faf9f6; /* Light grey */
    border-top: 8px solid #262626; /* Updated to new accent color */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -30px; /* Half of height */
    margin-left: -30px; /* Half of width */
    display: none; /* Hidden by default, shown by JS */
}

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

/* Install Banner Styles */
.install-banner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background-color: #262626; /* Darker main UI color */
    background: #06EEFF;
background: linear-gradient(90deg,rgba(6, 238, 255, 1) 0%, rgba(148, 60, 255, 1) 100%);
    color: #faf9f6;

    padding: 10px;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    box-shadow: 0 -2px 5px rgba(38, 38, 38, 0.2);
    z-index: 1000;
}

.install-banner p {
    margin: 0;
    color: #faf9f6; /* Ensure text is white in banner */
        color: #262626;
}

.install-button {
    background-color: #faf9f6; /* One of the card accent colors */
    color: #262626;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.dismiss-button {
    background: none;
    border: none;
    color: #faf9f6;
    font-size: 1.2em;
    cursor: pointer;
}

.theme-toggle-button i {
    font-size: 1.2em;
    vertical-align: middle;
}

.team-badge {
    width: 25px;
    height: 25px;
    vertical-align: middle;

}

/* Carousel Styles */
.carousel-container {
    position: relative;
    overflow: hidden;
}

.carousel-slides {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-container.card {
    padding: 0;
}

.carousel-slide {
    min-width: 100%;
    box-sizing: border-box;
    padding: 15px;
}

.carousel-dots {
    text-align: center;
    padding: 10px 0;
}

.carousel-dot {
    cursor: pointer;
    height: 24px;
    width: 24px;
    margin: 0 2px;
    background-color: #262626; /* Dark dot in light mode */
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.6s ease;
    color: #faf9f6; /* Light text in dark dot */
    font-size: 12px;
}

body.dark-mode .carousel-dot {
    background-color: #faf9f6; /* Light dot in dark mode */
    color: #262626; /* Dark text in light dot */
}

.carousel-dot.active {
    background-color: #faf9f6; /* Light active dot in light mode */
}

body.dark-mode .carousel-dot.active {
    background-color: #262626; /* Dark active dot in dark mode */
}

.chip-plays-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    padding-top: 10px;
}

.chip-play {
    display: flex;
    align-items: center;
    gap: 5px;
}

.chip-image {
    width: 25px;
    height: 25px;
}

.footer {
    background-color: #faf9f6;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #262626;
}

body.dark-mode .footer {
    background-color: #262626;
    border-top: 1px solid #faf9f6;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-logo-container {
    margin-bottom: 15px;
    align-items: center;
    display: flex;
    justify-content: center
}

.footer-logo {
    height: 60px;
}

.footer-logo.logo-dark {
    display: none;
}

body.dark-mode .footer-logo.logo-light {
    display: none;
}

body.dark-mode .footer-logo.logo-dark {
    display: block;
}

.tagline {
    font-size: 1em;
    margin-bottom: 15px;
}

.instagram-link {
    font-size: 1.2em;
    text-decoration: none;
    color: #262626;
}

body.dark-mode .instagram-link {
    color: #faf9f6;
}

.instagram-link i {
    margin-right: 8px;
}
.match-info{
    font-size: 0.8rem;
}



.fixture-ticker {
    overflow-x: auto;
    margin-bottom: 15px;
}

.ticker-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
  
}

.ticker-table th,
.ticker-table td {
    padding: 2px;
    text-align: center;
    border: 1px solid #ddd;
}

.ticker-table thead th {

    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
}

.team-column {
    text-align: left !important;
}

.team-cell {
    text-align: left !important;
    font-weight: 600;

    white-space: nowrap;
}

.team-badge-small {
    width: 30px;
    height: 30px;
    margin-right: 2px;
    vertical-align: middle;
}

.team-name {
    vertical-align: middle;
}

.gw-column {
    max-width: 60px;
}

.fixture-cell {
    font-size: 12px;
    font-weight: 500;
}

.opponent-name {
    display: block;
    font-weight: 600;
}

.home-away {
    display: block;
    font-size: 10px;
    opacity: 0.8;
}

/* FDR Color Coding - Based on Official FPL colors */
.fdr-1 {
    background-color: #01fc7a;
    color: #000;
}

.fdr-2 {
    background-color: #96f7a6;
    color: #000;
}

.fdr-3 {
    background-color: #e7e7e7;
    color: #000;
}

.fdr-4 {
    background-color: #ffb0b0;
    color: #000;
}

.fdr-5 {
    background-color: #ff003f;
    color: #fff;
}

.fdr-blank {
  
    
}

/* FDR Legend */
.fdr-legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 10px;
  
    border-radius: 4px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.fdr-box {
    width: 20px;
    height: 20px;

    display: inline-block;
}

/* Responsive */
@media (max-width: 768px) {
    .ticker-table {
        font-size: 11px;
    }
    
    .opponent-name {
        font-size: 11px;
    }
    
    .team-badge-small {
        width: 16px;
        height: 16px;
    }
}

.fdr-column {
    font-size: 12px;
    max-width: 40px
}

.avg-fdr-cell {
    text-align: center;
    font-weight: 700;
 
    
}

.differentials-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.differential-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e7e7e7;
    transition: background-color 0.2s;
}

.differential-item:hover {
    background-color: #f9f9f9;
     color: #262626;
}

.differential-item:last-child {
    border-bottom: none;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.player-details {
    display: flex;
    flex-direction: column;
}

.player-name {
    font-weight: 600;
    font-size: 14px;
}

.player-meta {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.player-stats {
    display: flex;
    gap: 15px;
}

.price-change-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.price-change-item span:first-child {
    width: 150px;
}

.price-change-item span:last-child {
    text-align: right;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
}

.stat-label {
    font-size: 10px;

    text-transform: uppercase;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
  
}

.highlight-ep {

    padding: 2px 8px;
    border-radius: 4px;
}
.deadline-info {
    text-align: center;
    margin-bottom: 20px;
}

.deadline-date {
    font-size: 16px;
    color: #666;
    font-weight: 500;
    margin: 0;
}

.countdown-display {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    margin-bottom: 10px;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}

.countdown-value {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.countdown-label {
    font-size: 12px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 5px;
    letter-spacing: 1px;
}

.deadline-passed {
    text-align: center;
    padding: 20px;
    background-color: #ff003f;
    border-radius: 8px;
}

.deadline-message {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

/* Urgent state when less than 24 hours */
.countdown-display.urgent {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff003f 100%);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .countdown-display {
        gap: 10px;
        padding: 15px;
    }
    
    .countdown-item {
        min-width: 60px;
    }
    
    .countdown-value {
        font-size: 28px;
    }
    
    .countdown-label {
        font-size: 10px;
    }
}
.season-stats {
    display: flex;
    justify-content: space-around;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-box.current {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    transform: scale(1.05);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 5px;
    letter-spacing: 1px;
}

.progress-container {
    margin-bottom: 20px;
}

.progress-bar-wrapper {
   
    margin-bottom: 30px;
}

.progress-bar-bg {
    width: 100%;
    height: 30px;
    background: linear-gradient(to right, #e0e0e0 0%, #f5f5f5 100%);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
   
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff87 0%, #60efff 50%, #00ff87 100%);
    background-size: 200% 100%;
    border-radius: 15px;
    transition: width 2s cubic-bezier(0.4, 0, 0.2, 1);
    animation: shimmer 3s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 15px;
    box-shadow: 0 2px 8px rgba(0, 255, 135, 0.4);
}

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

.progress-percentage {
    font-size: 14px;
    font-weight: 700;
    color: #37003c;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.progress-markers {
    position: relative;
    margin-top: 10px;
    
}

.milestone-marker {
    position: absolute;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.marker-dot {
    width: 10px;
    height: 10px;
    background-color: #ccc;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.milestone-marker.passed .marker-dot {
    background-color: #00ff87;
    transform: scale(1.2);
}

.marker-label {
    font-size: 10px;
    color: #666;
    margin-top: 5px;
    font-weight: 600;
}

.milestone-marker.passed .marker-label {
    color: #00ff87;
    font-weight: 700;
}



.phase-badge {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.timeline-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-icon {
    font-size: 20px;
}

.timeline-text {
    font-size: 14px;
    color: #666;
}

.timeline-text strong {
    color: #37003c;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 768px) {
    .season-stats {
        flex-direction: column;
    }
    
    .stat-box.current {
        transform: scale(1);
    }
    
    .stat-number {
        font-size: 24px;
    }
    
    .marker-label {
        font-size: 8px;
    }
}

.live-indicator {
    background-color: red;
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.8em;
    margin-left: 10px;
    display: none; /* Hidden by default */
    animation: flash 1s infinite alternate;
}

@keyframes flash {
    from { opacity: 1; }
    to { opacity: 0.3; }
}

.no-live-indicator {
    background-color: #6c757d; /* Grey color */
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.8em;
    margin-left: 10px;
    display: none; /* Hidden by default */
}

.menu-dropdown a i {
    margin-right: 8px;
}