/* Lineup Builder Styles */
.lineup-builder-section {
    min-height: 100vh;
    padding: 100px 20px 40px;
    background: var(--primary-bg);
}

.lineup-container {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 2rem;
    align-items: start;
}

/* Sidebar Styles */
.lineup-sidebar {
    background: var(--gradient-glass);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-xl);
    padding: 1.5rem;
    position: sticky;
    top: 100px;
}

.sidebar-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-section h3 i {
    color: var(--accent-color);
}

/* Color Options */
.color-group {
    margin-bottom: 1.5rem;
}

.color-group:last-child {
    margin-bottom: 0;
}

.color-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.color-picker-group {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
}

.color-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.color-btn:hover {
    transform: scale(1.1);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.color-btn.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
}

.color-btn.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    font-size: 1rem;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
}

/* Formation Options */
.formation-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.formation-btn {
    padding: 0.8rem;
    background: var(--gradient-glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.formation-btn:hover {
    background: var(--gradient-card);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.formation-btn.active {
    background: var(--gradient-accent);
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

/* Action Buttons */
.action-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.download-btn {
    background: var(--gradient-accent);
    color: var(--text-primary);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

.reset-btn {
    background: var(--gradient-glass);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.reset-btn:hover {
    background: var(--gradient-card);
    border-color: var(--accent-secondary);
    transform: translateY(-3px);
}

/* Pitch Container */
.pitch-container {
    background: var(--gradient-glass);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-xl);
    padding: 2rem;
    min-height: 800px;
}

.pitch {
    width: 100%;
    aspect-ratio: 2/3;
    max-width: 600px;
    margin: 0 auto;
    background: #2d5016;
    background-image:
        repeating-linear-gradient(0deg,
            transparent,
            transparent 50px,
            rgba(0, 0, 0, 0.1) 50px,
            rgba(0, 0, 0, 0.1) 100px);
    border-radius: var(--border-radius-lg);
    border: 2px solid rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: background 0.3s ease;
}

/* Pitch Lines */
.pitch-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.center-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%);
}

.center-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.center-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.penalty-area {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 14%;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.penalty-area-top {
    top: 0;
    border-top: none;
}

.penalty-area-bottom {
    bottom: 0;
    border-bottom: none;
}

.penalty-area-top::before {
    content: '';
    position: absolute;
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}

.penalty-area-bottom::before {
    content: '';
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}

.goal-area {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 25%;
    height: 6%;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.goal-area-top {
    top: 0;
    border-top: none;
}

.goal-area-bottom {
    bottom: 0;
    border-bottom: none;
}

/* Players Container */
.players-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Pitch Watermark */
.pitch-watermark {
    position: absolute;
    bottom: -2px;
    right: 25px;
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.8),
        0 0 10px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
    pointer-events: none;
    z-index: 100;
    font-family: 'Inter', sans-serif;
}

/* Player Styles - Jersey Image Design */
.player {
    position: absolute;
    width: 120px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    cursor: move;
    user-select: none;
    transition: transform 0.2s ease;
    z-index: 10;
}

.player:hover {
    transform: scale(1.08);
    z-index: 20;
}

.player.dragging {
    opacity: 0.7;
    z-index: 100;
    cursor: grabbing;
}

.player-jersey {
    width: 42px;
    height: 42px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
    transition: var(--transition);
}

.player-jersey img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.player:hover .player-jersey {
    filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.5)) drop-shadow(0 3px 10px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 25px rgba(0, 212, 255, 0.5));
    transform: translateY(-3px);
}

.player-name {
    margin-top: 0.4rem;
    padding: 0.4rem 1.2rem;
    background: rgba(0, 0, 0, 0.75);
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    white-space: nowrap;
    min-width: 90px;
    max-width: 140px;
    overflow: visible;
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(0, 212, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    line-height: 1.2;
    cursor: text;
    transition: var(--transition);
}

.player-name:hover {
    background: rgba(0, 0, 0, 0.95);
    border-color: #00f2fe;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.8),
        0 0 25px rgba(0, 212, 255, 0.6),
        inset 0 1px 2px rgba(255, 255, 255, 0.15);
}

.player-name[contenteditable="true"]:focus {
    outline: none;
    background: rgba(0, 212, 255, 0.15);
    border-color: #00f2fe;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.8),
        0 0 30px rgba(0, 212, 255, 0.8),
        inset 0 0 20px rgba(0, 212, 255, 0.2);
}

.player-name[contenteditable="true"] {
    outline: 2px solid var(--accent-color);
    background: rgba(0, 212, 255, 0.2);
}

.player-delete {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    background: #ff3355;
    border: 3px solid #ffffff;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 900;
    color: #ffffff;
    transition: var(--transition);
    z-index: 30;
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.5),
        0 0 12px rgba(255, 51, 85, 0.4);
    line-height: 1;
}

.player:hover .player-delete {
    display: flex;
}

.player-delete:hover {
    transform: scale(1.2);
    background: #ff1a3d;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(255, 51, 85, 0.7);
}

/* Info Panel */
.info-panel {
    background: var(--gradient-glass);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-xl);
    padding: 1.5rem;
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-card {
    background: var(--gradient-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
}

.info-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.2);
}

.info-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-accent);
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.info-icon.gradient {
    background: var(--gradient-secondary);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

.info-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-list li:last-child {
    border-bottom: none;
}

.info-list li i {
    color: var(--accent-color);
    font-size: 0.8rem;
    width: 16px;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .lineup-container {
        grid-template-columns: 250px 1fr 250px;
        gap: 1.5rem;
    }
}

@media (max-width: 1200px) {
    .lineup-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .lineup-sidebar,
    .info-panel {
        position: static;
    }

    .lineup-sidebar {
        order: -1;
    }

    .info-panel {
        order: 1;
    }

    .sidebar-section {
        display: grid;
        grid-template-columns: 1fr 2fr;
        gap: 1rem;
        align-items: start;
    }

    .sidebar-section h3 {
        margin-bottom: 0;
    }

    .formation-options {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .lineup-builder-section {
        padding: 90px 15px 30px;
    }

    .lineup-container {
        gap: 1.5rem;
    }

    .sidebar-section {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .sidebar-section h3 {
        margin-bottom: 0.8rem;
    }

    .formation-options {
        grid-template-columns: repeat(3, 1fr);
    }

    .pitch-container {
        padding: 1rem;
    }

    .pitch {
        max-width: 100%;
    }

    .player {
        width: 70px;
        height: 90px;
    }

    .player-jersey {
        width: 40px;
        height: 40px;
    }

    .player-name {
        font-size: 0.7rem;
        min-width: 85px;
        max-width: 130px;
        padding: 0.4rem 1rem;
    }

    .info-panel {
        gap: 1rem;
    }

    .info-card {
        padding: 1rem;
    }

    .pitch-watermark {
        font-size: 0.65rem;
        bottom: 8px;
        right: 12px;
    }
}

@media (max-width: 480px) {
    .color-picker-group {
        grid-template-columns: repeat(4, 1fr);
    }

    .formation-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .player {
        width: 65px;
        height: 80px;
    }

    .player-jersey {
        width: 38px;
        height: 38px;
    }

    .player-name {
        font-size: 0.65rem;
        min-width: 80px;
        max-width: 120px;
        padding: 0.35rem 0.8rem;
        letter-spacing: 0.5px;
    }

    .info-card {
        padding: 1rem;
    }

    .info-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}