@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Single font stack for layout + Bootstrap (loaded after Bootstrap to override) */
    --ipl-font-sans: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --bs-font-sans-serif: var(--ipl-font-sans);
    --bs-body-font-family: var(--ipl-font-sans);
    --bs-heading-font-family: var(--ipl-font-sans);

    --ipl-primary: #FF6B00;
    --ipl-primary-glow: rgba(255, 107, 0, 0.4);
    --ipl-secondary: #1A1A2E;
    --ipl-accent: #FFD700;
    --ipl-bg: #0F0F1A;
    --ipl-card-bg: #1E1E30;
    --ipl-text-primary: #FFFFFF;
    --ipl-text-muted: #A0A0B0;
    --ipl-success: #00C851;
    --ipl-danger: #FF4444;
    /* Auth forms: single surface for field + floating-label notch */
    --ipl-auth-field-bg: #1f1f32;
    --ipl-auth-field-bg-focus: #28283c;
    --ipl-auth-label: #d4d4e5;
}

html {
    font-family: var(--ipl-font-sans);
}

body {
    background-color: var(--ipl-bg);
    color: var(--ipl-text-primary);
    font-family: var(--ipl-font-sans);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    background-image: radial-gradient(circle at 15% 50%, rgba(26, 26, 46, 0.8), transparent 25%),
                      radial-gradient(circle at 85% 30%, rgba(255, 107, 0, 0.05), transparent 25%);
    background-attachment: fixed;
}

/* Force theme font on Bootstrap components that set their own stack */
.navbar,
.btn,
.form-control,
.form-select,
.breadcrumb,
.dropdown-menu,
.alert {
    font-family: var(--ipl-font-sans);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--ipl-font-sans);
}

/* Themed breadcrumb (login / register and reusable) */
.ipl-breadcrumb {
    margin-bottom: 0.85rem;
}

.ipl-breadcrumb .ipl-breadcrumb-list {
    --bs-breadcrumb-margin-bottom: 0;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    padding: 0.65rem 1.1rem;
    margin: 0;
    background: rgba(30, 30, 48, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    font-family: var(--ipl-font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.03em;
}

.ipl-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    float: none;
    padding: 0 0.35rem 0 0;
    color: var(--ipl-text-muted);
    font-weight: 500;
}

.ipl-breadcrumb .breadcrumb-item a {
    color: var(--ipl-primary);
    text-decoration: none;
    font-weight: 600;
}

.ipl-breadcrumb .breadcrumb-item a:hover {
    color: var(--ipl-accent);
    text-decoration: underline;
}

.ipl-breadcrumb .breadcrumb-item.active {
    color: var(--ipl-text-primary);
    font-weight: 600;
}

/* Auth card: headings + body copy inside the box */
.ipl-auth-card {
    font-family: var(--ipl-font-sans);
}

.ipl-auth-card h2,
.ipl-auth-card h3 {
    font-family: var(--ipl-font-sans);
    font-weight: 700;
    letter-spacing: 0.03em;
}

.ipl-auth-card .ipl-auth-sidebar-title {
    letter-spacing: 0.04em;
}

.ipl-auth-card .ipl-auth-lead {
    font-size: 0.9375rem;
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.ipl-auth-card .ipl-auth-footer-note {
    font-size: 0.875rem;
    letter-spacing: 0.02em;
}

.ipl-auth-form .form-check-label {
    font-family: var(--ipl-font-sans);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Auth pages: vertical rhythm without negative margins */
.auth-page-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 220px);
    padding-bottom: 1rem;
}

@media (max-width: 767.98px) {
    .auth-page-wrap {
        min-height: auto;
        padding-top: 0.5rem;
        padding-bottom: 2rem;
    }
}

/* Flash alerts on dark UI */
.ipl-alert {
    font-family: var(--ipl-font-sans);
    border-radius: 10px;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.ipl-alert-success {
    background: rgba(0, 200, 81, 0.12) !important;
    color: #c8ffd8 !important;
    border-left: 4px solid var(--ipl-success) !important;
}
.ipl-alert-danger {
    background: rgba(255, 68, 68, 0.12) !important;
    color: #ffd4d4 !important;
    border-left: 4px solid var(--ipl-danger) !important;
}

/* Glassmorphism Card styling */
.ipl-card {
    background: rgba(30, 30, 48, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    overflow: hidden;
}

.ipl-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(255, 107, 0, 0.15);
    border-color: rgba(255, 107, 0, 0.2);
}

.ipl-card .card-body {
    padding: 1.5rem;
}

/* Custom Buttons */
.btn-ipl-primary {
    font-family: var(--ipl-font-sans);
    background: linear-gradient(135deg, var(--ipl-primary), #FF8C00);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.6rem 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
}

.btn-ipl-primary:hover, .btn-ipl-primary:focus {
    background: linear-gradient(135deg, #FF8C00, #FF6B00);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.5);
    outline: none;
}

.btn-ipl-primary:disabled {
    background: #555;
    box-shadow: none;
    transform: none;
    color: #aaa;
    cursor: not-allowed;
}

.btn-ipl-outline {
    background: transparent;
    color: var(--ipl-primary);
    border: 2px solid var(--ipl-primary);
    border-radius: 8px;
    font-weight: 600;
    padding: 0.5rem 1.2rem;
    transition: all 0.3s ease;
}

.btn-ipl-outline:hover {
    background: var(--ipl-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.4);
}

/* Team Badges */
.team-logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--ipl-card-bg);
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.1);
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.team-logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.team-logo-container.size-lg { width: 64px; height: 64px; }
.team-logo-container.size-md { width: 48px; height: 48px; }
.team-logo-container.size-sm { width: 32px; height: 32px; }

.team-initials {
    font-weight: bold;
    color: var(--ipl-text-primary);
    font-size: 1.2rem;
}
.size-sm .team-initials { font-size: 0.8rem; }

/* Status Badges */
.badge {
    border-radius: 50px;
    padding: 0.4em 0.8em;
    font-weight: 500;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.badge-predicted { background-color: rgba(255, 215, 0, 0.2); color: var(--ipl-accent); border: 1px solid var(--ipl-accent); }
.badge-correct { background-color: rgba(0, 200, 81, 0.2); color: var(--ipl-success); border: 1px solid var(--ipl-success); }
.badge-wrong { background-color: rgba(255, 68, 68, 0.2); color: var(--ipl-danger); border: 1px solid var(--ipl-danger); }
.badge-pending { background-color: rgba(160, 160, 176, 0.2); color: var(--ipl-text-muted); border: 1px solid var(--ipl-text-muted); }
.badge-scheduled { background-color: rgba(52, 152, 219, 0.2); color: #3498db; border: 1px solid #3498db; }
.badge-live { background-color: rgba(255, 68, 68, 0.8); color: white; animation: pulse 2s infinite; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(255, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0); }
}

/* Points Chip */
.points-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.2));
    color: var(--ipl-accent);
    border: 1px solid var(--ipl-accent);
    border-radius: 50px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.1);
}

.points-chip.negative {
    color: var(--ipl-danger);
    border-color: var(--ipl-danger);
    background: rgba(255, 68, 68, 0.1);
}

/* Countdown Timer */
.countdown-timer {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    color: var(--ipl-primary);
    font-weight: 600;
    letter-spacing: 1px;
    font-size: 1.1rem;
    background: rgba(0,0,0,0.3);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,107,0,0.2);
    display: inline-block;
}
.countdown-timer.danger {
    color: var(--ipl-danger);
    border-color: var(--ipl-danger);
    animation: flash 1s infinite alternate;
}
@keyframes flash {
    from { color: var(--ipl-primary); }
    to { color: var(--ipl-danger); text-shadow: 0 0 8px rgba(255, 68, 68, 0.6); }
}

/* Utilities */
.text-muted-custom { color: var(--ipl-text-muted) !important; }
.text-primary-custom { color: var(--ipl-primary) !important; }
.text-accent { color: var(--ipl-accent) !important; }
.bg-dark-custom { background-color: var(--ipl-card-bg) !important; }
.gradient-text {
    background: linear-gradient(90deg, #FF6B00, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--ipl-bg); }
::-webkit-scrollbar-thumb { background: rgba(255, 107, 0, 0.3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--ipl-primary); }

/* Forms */
.form-control, .form-select {
    background-color: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--ipl-text-primary);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}
.form-control:focus, .form-select:focus {
    background-color: rgba(0,0,0,0.4);
    border-color: var(--ipl-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.25);
    color: var(--ipl-text-primary);
}
.form-label { font-weight: 500; font-size: 0.9rem; color: #ddd; }

/* Floating Label Overrides for Dark Theme */
.form-floating > label {
    color: var(--ipl-text-muted) !important;
    font-weight: 500;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--ipl-primary) !important;
    font-weight: 700;
    opacity: 1 !important;
}

/* Fix Bootstrap's border mask that typically cuts off the input border */
.form-floating > .form-control:focus ~ label::after,
.form-floating > .form-control:not(:placeholder-shown) ~ label::after {
    background-color: transparent !important;
}

/* Login / Register: labels & placeholders must contrast with field background */
.ipl-auth-form .form-floating > .form-control {
    background-color: var(--ipl-auth-field-bg) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}

.ipl-auth-form .form-floating > .form-control:focus {
    background-color: var(--ipl-auth-field-bg-focus) !important;
    border-color: var(--ipl-primary) !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.22) !important;
    color: #fff !important;
}

.ipl-auth-form .form-floating > .form-control::placeholder {
    color: rgba(255, 255, 255, 0.45);
    opacity: 1;
}

.ipl-auth-form .form-floating > label {
    color: var(--ipl-auth-label) !important;
    font-weight: 600;
}

.ipl-auth-form .form-floating > .form-control:focus ~ label,
.ipl-auth-form .form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--ipl-primary) !important;
    font-weight: 700;
}

/* Match Bootstrap’s label “notch” to the field so text doesn’t blend into the box */
.ipl-auth-form .form-floating > label::after {
    background-color: var(--ipl-auth-field-bg) !important;
}

.ipl-auth-form .form-floating > .form-control:focus ~ label::after,
.ipl-auth-form .form-floating > .form-control:not(:placeholder-shown) ~ label::after {
    background-color: var(--ipl-auth-field-bg-focus) !important;
}

.ipl-auth-form .form-floating > .form-control:-webkit-autofill,
.ipl-auth-form .form-floating > .form-control:-webkit-autofill:hover,
.ipl-auth-form .form-floating > .form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 1000px var(--ipl-auth-field-bg) inset !important;
    box-shadow: 0 0 0 1000px var(--ipl-auth-field-bg) inset !important;
    transition: background-color 99999s ease-out;
}

.ipl-auth-form .form-floating > .form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--ipl-auth-field-bg-focus) inset !important;
    box-shadow: 0 0 0 1000px var(--ipl-auth-field-bg-focus) inset !important;
}

.ipl-auth-form .form-check-input {
    border-color: rgba(255, 255, 255, 0.35);
    background-color: rgba(0, 0, 0, 0.2);
}

.ipl-auth-form .form-check-input:checked {
    background-color: var(--ipl-primary);
    border-color: var(--ipl-primary);
}

/* Dashboard match cards: date + status badge (no absolute overlap) */
.match-card-meta__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: start;
    gap: 0.35rem 0.5rem;
}

.match-card-meta__time {
    line-height: 1.4;
    word-break: break-word;
    max-width: 100%;
}

.match-card-meta__badge {
    justify-self: end;
    min-width: min-content;
}

.match-card-meta__spacer {
    min-width: 0;
}

@media (max-width: 575.98px) {
    .match-card-meta__grid {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .match-card-meta__spacer {
        display: none;
    }

    .match-card-meta__badge {
        justify-self: center;
        order: -1;
    }

    .match-card-meta__time {
        order: 0;
    }
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .match-card-teams { flex-direction: column; text-align: center; }
    .match-card-teams .vs-badge { margin: 15px 0; }
    .countdown-timer { font-size: 0.95rem; }
    .brand-title { font-size: 1.2rem; }
}

/* Toast container */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1055;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ipl-toast {
    min-width: 250px;
    background: rgba(30,30,48,0.95);
    backdrop-filter: blur(10px);
    border-left: 4px solid var(--ipl-primary);
    border-radius: 6px;
    padding: 12px 16px;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.ipl-toast.show { transform: translateX(0); }
.ipl-toast.success { border-left-color: var(--ipl-success); }
.ipl-toast.error { border-left-color: var(--ipl-danger); }
