/* ========================================
   DISKI ZONE FANTASY - MOBILE RESPONSIVE STYLES
   ======================================== */

/* Ad Partial Styles */
.display-ad {
    margin: 20px 0;
    text-align: center;
}

.in-article-ad {
    margin: 20px 0;
    text-align: center;
}

.in-feed-ad {
    margin: 5px 0;
}

.multiplex-ad {
    margin: 25px 0;
}

/* Hide mobile menu overlay on desktop */
@media (min-width: 1100px) {
    .mobile-menu-overlay {
        display: none !important;
    }
}

/* Mobile-First Base Styles */
@media (max-width: 767px) {

    /* ========== LAYOUT FIXES ========== */

    /* Remove fixed sidebar margin on mobile */
    .main-content {
        margin-left: 0 !important;
        margin-top: 65px !important;
    }

    /* Mobile menu overlay - must be just below sidebar z-index (99999) */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99998;
    }

    .mobile-menu-overlay.active {
        display: block;
    }

    /* ========== SQUAD SELECTION PAGE ========== */
    /* All Squad Selection mobile styles are in SquadSelection.css - do NOT override here */

    /* Stack columns vertically on mobile */
    .row > [class*="col-md"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* ========== TEAM SELECTION PAGE ========== */
    /* All .player rules scoped to .pitchContainer so they don't affect SquadSelection's .pitch-container */

    /* Chips Container Mobile */
    .chips-container {
        gap: 8px !important;
        padding: 8px 5px !important;
    }

    .chip-card {
        min-width: 85px !important;
        padding: 10px 12px !important;
        flex: 0 0 calc(25% - 8px) !important;
        max-width: 100px !important;
    }

    .chip-card:not(.disabled):not(.active)::after {
        font-size: 0.5rem !important;
        padding: 2px 4px !important;
    }

    .chip-card.disabled::after {
        font-size: 0.5rem !important;
        padding: 2px 4px !important;
    }

    .chip-card.active::after {
        font-size: 0.5rem !important;
        padding: 2px 4px !important;
    }

    .chip-icon {
        font-size: 1.8rem !important;
        margin-bottom: 6px !important;
    }

    .chip-name {
        font-size: 0.7rem !important;
        margin-bottom: 8px !important;
    }

    .chip-play-btn {
        padding: 4px 14px !important;
        font-size: 0.7rem !important;
        min-width: 65px !important;
    }

    /* Captain Instruction Mobile */
    .captain-instruction {
        font-size: 0.8rem !important;
        padding: 10px 15px !important;
        margin: 10px 5px !important;
    }

    /* View Toggle Mobile */
    .view-toggle {
        padding: 3px !important;
        margin: 10px auto !important;
    }

    .view-btn {
        padding: 8px 20px !important;
        font-size: 0.85rem !important;
    }

    /* Pitch container for team selection ONLY */
    .pitchContainer {
        height: auto !important;
        min-height: 650px !important;
        background-size: cover !important;
        background-position: center !important;
        padding: 30px 12px 20px 12px !important;
        margin-top: 0 !important;
        position: relative !important;
    }

    #goalkeeperContainer {
        width: 100% !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: space-evenly !important;
        row-gap: 0 !important;
        column-gap: 0 !important;
        margin-bottom: 25px !important;
        padding: 0 8px !important;
        box-sizing: border-box !important;
    }

    #defenderContainer,
    #midfielderContainer,
    #forwardContainer {
        width: 100% !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        gap: 3px !important;
        margin-bottom: 15px !important;
        padding: 0 2px !important;
        box-sizing: border-box !important;
    }

    #reserveContainer {
        height: auto !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        padding: 15px 5px !important;
        gap: 3px !important;
        background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 50%, #1B5E20 100%) !important;
        border-radius: 12px !important;
        margin-top: 15px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
        box-sizing: border-box !important;
    }

    /* Substitutes heading */
    #substitutes-header {
        font-size: 1.1rem !important;
        margin-bottom: 15px !important;
        text-align: center !important;
        color: #333 !important;
    }

    /* Player cards - SCOPED to TeamSelection's .pitchContainer only */
    .pitchContainer .player {
        width: auto !important;
        max-width: 65px !important;
        min-width: 45px !important;
        flex: 1 1 auto !important;
        height: auto !important;
        min-height: 80px !important;
        margin: 0 !important;
        font-size: 8px !important;
        padding: 5px 3px !important;
        background-color: rgba(30, 60, 30, 0.6) !important;
        border: 1px solid #fff !important;
        color: white !important;
        border-radius: 10px !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    /* Reserve container player cards */
    #reserveContainer .player {
        width: auto !important;
        max-width: 65px !important;
        min-width: 45px !important;
        flex: 1 1 auto !important;
        height: auto !important;
        min-height: 80px !important;
        margin: 0 !important;
        font-size: 8px !important;
        padding: 5px 3px !important;
    }

    /* Swap highlight effects - scoped to TeamSelection */
    .pitchContainer .player.highlight-initiator,
    #reserveContainer .player.highlight-initiator {
        border: 3px solid red !important;
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.6), rgba(0, 0, 0, 0.35) 0px 5px 15px !important;
        transform: scale(1.05) !important;
        z-index: 100 !important;
    }

    .pitchContainer .player.highlight-same,
    #reserveContainer .player.highlight-same {
        border: 3px solid #FFD700 !important;
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), rgba(0, 0, 0, 0.35) 0px 5px 15px !important;
        background-color: rgba(30, 60, 30, 0.8) !important;
    }

    .pitchContainer .player.disabled,
    #reserveContainer .player.disabled {
        opacity: 0.4 !important;
        pointer-events: none !important;
    }

    .pitchContainer .player img,
    #reserveContainer .player img {
        max-height: 38px !important;
        width: auto !important;
        margin-bottom: 3px !important;
    }

    .player-name-block {
        text-align: center !important;
        width: 100% !important;
    }

    .player-surname-team {
        font-size: 0.58rem !important;
        font-weight: 600 !important;
        margin-bottom: 1px !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
    }

    .player-next-opponent-team {
        font-size: 0.5rem !important;
        color: #ccc !important;
        line-height: 1.1 !important;
    }

    /* Position labels */
    .gk-label::before,
    .def-label::before,
    .mid-label::before,
    .for-label::before {
        font-size: 10px !important;
        top: -20px !important;
    }

    /* ========== CARDS & CONTAINERS ========== */

    .card {
        margin-bottom: 15px;
    }

    .card-body {
        padding: 10px !important;
    }

    .card-title {
        font-size: 0.9rem !important;
    }

    /* ========== MATCHES SECTION ========== */

    .match {
        font-size: 0.85rem !important;
    }

    .match-header {
        padding: 10px !important;
        font-size: 0.9rem !important;
    }

    .match-details {
        padding: 8px !important;
        font-size: 0.8rem !important;
    }

    .team-logo {
        width: 20px !important;
        height: 20px !important;
    }

    /* ========== MODALS ========== */

    .modal-dialog {
        margin: 10px auto;
        max-width: calc(100% - 20px);
        display: flex !important;
        align-items: center !important;
        min-height: calc(100vh - 20px) !important;
        justify-content: center !important;
    }

    .modal-body {
        max-height: 60vh;
        overflow-y: auto;
    }

    .modal-content {
        width: 100%;
    }

    /* ========== TABLES ========== */

    .table-responsive {
        font-size: 0.8rem;
    }

    .table th,
    .table td {
        padding: 0.5rem !important;
        font-size: 0.75rem !important;
    }

    /* ========== FORMS & INPUTS ========== */

    .form-control,
    select,
    input {
        font-size: 14px !important;
        padding: 10px !important;
    }

    .search-bar input {
        font-size: 14px !important;
    }

    .search-bar button {
        padding: 10px !important;
    }

    /* ========== BUTTONS ========== */

    .btn {
        font-size: 0.85rem !important;
        padding: 8px 12px !important;
    }

    .btn-custom,
    .btn-nav {
        font-size: 0.85rem !important;
        padding: 8px 12px !important;
    }

    .submit-btn {
        width: 100% !important;
        margin-bottom: 10px;
    }

    /* ========== UTILITY CLASSES ========== */

    .text-truncate-mobile {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Hide elements on mobile */
    .hide-mobile {
        display: none !important;
    }

    /* Stack flex items */
    .flex-mobile-column {
        flex-direction: column !important;
    }

    /* ========== PAGE CONTENT ========== */

    .page-content {
        padding: 10px !important;
    }

    .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/* Tablet Breakpoint (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {

    .main-content {
        margin-left: 0 !important;
        margin-top: 70px !important;
    }

    /* Mobile menu overlay for tablet */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99998;
    }

    .mobile-menu-overlay.active {
        display: block;
    }

    /* TeamSelection only */
    .pitchContainer {
        min-height: 600px !important;
        padding: 70px 15px 15px 15px !important;
    }

    .pitchContainer .player {
        width: 12% !important;
        font-size: 10px !important;
    }
}

/* Small Desktop Breakpoint (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {

    .main-content {
        margin-left: 240px !important;
    }

    /* TeamSelection only */
    .pitchContainer .player {
        width: 10% !important;
        font-size: 0.6vw !important;
    }
}

/* Touch-friendly improvements for all devices */
@media (hover: none) and (pointer: coarse) {

    /* Increase touch targets - scoped to TeamSelection */
    .pitchContainer .player {
        min-height: 70px;
        min-width: 70px;
    }

    .player-row {
        min-height: 50px;
        cursor: pointer;
    }

    /* Make buttons more touch-friendly (exclude pitch player buttons) */
    .btn,
    button:not(.remove-player):not(.restore-icon) {
        min-height: 44px;
        min-width: 44px;
    }

    /* Larger tap areas for player selection list */
    .player-info {
        padding: 5px;
    }
}

/* Portrait orientation optimizations for mobile */
@media (max-width: 767px) and (orientation: portrait) {

    /* TeamSelection only */
    .pitchContainer {
        min-height: 550px !important;
        padding: 20px 5px 15px 5px !important;
    }

    #goalkeeperContainer {
        width: 100% !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        gap: 3px !important;
        margin-bottom: 15px !important;
        padding: 0 5px !important;
    }

    #defenderContainer,
    #midfielderContainer,
    #forwardContainer {
        width: 100% !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        gap: 3px !important;
        margin-bottom: 15px !important;
        padding: 0 5px !important;
    }

    #reserveContainer {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        gap: 3px !important;
        padding: 15px 5px !important;
    }

    .pitchContainer .player {
        width: auto !important;
        max-width: 65px !important;
        min-width: 45px !important;
        flex: 1 1 auto !important;
        min-height: 80px !important;
        padding: 5px 3px !important;
        margin: 0 !important;
    }

    .pitchContainer .player img,
    #reserveContainer .player img {
        max-height: 38px !important;
    }

    .player-surname-team {
        font-size: 0.58rem !important;
    }

    .player-next-opponent-team {
        font-size: 0.5rem !important;
    }

    /* Portrait - Swap highlight effects */
    .pitchContainer .player.highlight-initiator,
    #reserveContainer .player.highlight-initiator {
        border: 3px solid red !important;
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.6), rgba(0, 0, 0, 0.35) 0px 5px 15px !important;
        transform: scale(1.05) !important;
        z-index: 100 !important;
    }

    .pitchContainer .player.highlight-same,
    #reserveContainer .player.highlight-same {
        border: 3px solid #FFD700 !important;
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), rgba(0, 0, 0, 0.35) 0px 5px 15px !important;
        background-color: rgba(30, 60, 30, 0.8) !important;
    }

    .pitchContainer .player.disabled,
    #reserveContainer .player.disabled {
        opacity: 0.4 !important;
        pointer-events: none !important;
    }
}

/* Landscape orientation fixes for mobile */
@media (max-width: 767px) and (orientation: landscape) {

    /* TeamSelection only */
    .pitchContainer {
        height: 80vh;
        max-height: 400px;
    }

    .pitchContainer .player {
        width: 15% !important;
        height: auto !important;
        min-height: 50px;
        background-color: rgba(30, 60, 30, 0.6) !important;
        border: 1px solid #fff !important;
    }

    #reserveContainer {
        height: auto !important;
        max-height: 120px;
    }

    /* Landscape - Swap highlight effects */
    .pitchContainer .player.highlight-initiator,
    #reserveContainer .player.highlight-initiator {
        border: 3px solid red !important;
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.6), rgba(0, 0, 0, 0.35) 0px 5px 15px !important;
        transform: scale(1.05) !important;
        z-index: 100 !important;
    }

    .pitchContainer .player.highlight-same,
    #reserveContainer .player.highlight-same {
        border: 3px solid #FFD700 !important;
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), rgba(0, 0, 0, 0.35) 0px 5px 15px !important;
        background-color: rgba(30, 60, 30, 0.8) !important;
    }

    .pitchContainer .player.disabled,
    #reserveContainer .player.disabled {
        opacity: 0.4 !important;
        pointer-events: none !important;
    }
}

/* Very small devices in portrait (< 375px) */
@media (max-width: 374px) and (orientation: portrait) {

    /* TeamSelection only */
    .pitchContainer {
        min-height: 500px !important;
        padding: 15px 3px 12px 3px !important;
    }

    .pitchContainer .player {
        width: auto !important;
        max-width: 55px !important;
        min-width: 40px !important;
        flex: 1 1 auto !important;
        font-size: 7px !important;
        min-height: 72px !important;
        padding: 4px 2px !important;
    }

    #goalkeeperContainer {
        gap: 2px !important;
        padding: 0 3px !important;
        margin-bottom: 12px !important;
    }

    #defenderContainer,
    #midfielderContainer,
    #forwardContainer {
        flex-wrap: nowrap !important;
        gap: 2px !important;
        padding: 0 3px !important;
        margin-bottom: 12px !important;
    }

    #reserveContainer {
        flex-wrap: nowrap !important;
        gap: 2px !important;
        padding: 12px 3px !important;
    }

    .pitchContainer .player img,
    #reserveContainer .player img {
        max-height: 32px !important;
    }

    .player-surname-team {
        font-size: 0.5rem !important;
    }

    .player-next-opponent-team {
        font-size: 0.45rem !important;
    }

    .card-title {
        font-size: 0.8rem !important;
    }

    /* Very small - Swap highlight effects */
    .pitchContainer .player.highlight-initiator,
    #reserveContainer .player.highlight-initiator {
        border: 3px solid red !important;
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.6), rgba(0, 0, 0, 0.35) 0px 5px 15px !important;
        transform: scale(1.05) !important;
        z-index: 100 !important;
    }

    .pitchContainer .player.highlight-same,
    #reserveContainer .player.highlight-same {
        border: 3px solid #FFD700 !important;
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), rgba(0, 0, 0, 0.35) 0px 5px 15px !important;
        background-color: rgba(30, 60, 30, 0.8) !important;
    }

    .pitchContainer .player.disabled,
    #reserveContainer .player.disabled {
        opacity: 0.4 !important;
        pointer-events: none !important;
    }
}

/* ========================================
   DEADLINE BANNER - GLOBAL STYLES
   ======================================== */

.deadline-banner {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.deadline-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/assets/images/back-pattern-2.png') right top no-repeat;
    opacity: 0.1;
    pointer-events: none;
}

.deadline-banner-icon {
    font-size: 1.5rem;
    color: #73EC8B;
    flex-shrink: 0;
}

.deadline-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.deadline-banner-label {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    font-weight: 500;
}

.deadline-banner-gameweek {
    color: #73EC8B;
    font-weight: 700;
}

.deadline-banner-time {
    background: rgba(115, 236, 139, 0.15);
    border: 1px solid rgba(115, 236, 139, 0.3);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.deadline-banner-time i {
    color: #73EC8B;
    font-size: 1.1rem;
}

/* Deadline banner responsive */
@media (max-width: 767px) {
    .deadline-banner {
        padding: 12px 16px;
        margin-bottom: 15px;
        gap: 10px;
        flex-direction: column;
        text-align: center;
    }

    .deadline-banner-icon {
        font-size: 1.2rem;
    }

    .deadline-banner-content {
        flex-direction: column;
        gap: 8px;
    }

    .deadline-banner-label {
        font-size: 0.85rem;
    }

    .deadline-banner-time {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .deadline-banner {
        padding: 10px 12px;
        border-radius: 8px;
    }

    .deadline-banner-label {
        font-size: 0.8rem;
    }

    .deadline-banner-time {
        font-size: 0.85rem;
        padding: 5px 10px;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .vertical-menu,
    .mobile-menu-toggle,
    .btn,
    button {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }
}

/* ========================================
   WEEKLY PRIZE BANNER
   ======================================== */
.weekly-prize-banner {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 12px;
    padding: 18px 24px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 215, 0, 0.25);
}

.weekly-prize-glow {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.weekly-prize-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

.weekly-prize-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700 0%, #FFA000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.weekly-prize-icon i {
    font-size: 24px;
    color: #1a1a2e;
}

.weekly-prize-text {
    flex: 1;
}

.weekly-prize-title {
    font-size: 16px;
    font-weight: 700;
    color: #FFD700;
    margin-bottom: 2px;
}

.weekly-prize-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

.weekly-prize-amount {
    text-align: center;
}

.weekly-prize-db {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.35);
    padding: 8px 16px;
    border-radius: 8px;
    color: #FFD700;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}

.weekly-prize-db i {
    font-size: 18px;
}

/* Weekly prize sidebar variant */
.weekly-prize-banner.sidebar-variant {
    margin: 12px 0 0;
    padding: 14px 16px;
    border-radius: 8px;
}

.weekly-prize-banner.sidebar-variant .weekly-prize-content {
    flex-direction: column;
    text-align: center;
    gap: 10px;
}

.weekly-prize-banner.sidebar-variant .weekly-prize-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
}

.weekly-prize-banner.sidebar-variant .weekly-prize-icon i {
    font-size: 20px;
}

.weekly-prize-banner.sidebar-variant .weekly-prize-title {
    font-size: 14px;
}

.weekly-prize-banner.sidebar-variant .weekly-prize-desc {
    font-size: 12px;
}

.weekly-prize-banner.sidebar-variant .weekly-prize-db {
    font-size: 14px;
    padding: 6px 12px;
}

@media (max-width: 767px) {
    .weekly-prize-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .weekly-prize-title {
        font-size: 15px;
    }

    .weekly-prize-desc {
        font-size: 12px;
    }

    .weekly-prize-banner {
        padding: 16px;
    }
}
