/* match_setup.css - Match Setup Page Styles */

.match-setup-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.setup-section {
    background: rgba(30, 35, 45, 0.95);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.setup-section h3 {
    color: #00D9FF;
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 2px solid rgba(0, 217, 255, 0.3);
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #ffffff;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 14px 16px;
    background: linear-gradient(145deg, rgba(30, 35, 45, 0.95), rgba(20, 25, 35, 0.95));
    border: 2px solid rgba(0, 217, 255, 0.2);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Custom dropdown arrow */
.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300D9FF' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px;
    padding-right: 45px;
    cursor: pointer;
}

.form-group select:hover {
    border-color: rgba(0, 217, 255, 0.5);
}

.form-group select:focus {
    border-color: #00D9FF;
    box-shadow: 0 0 0 4px rgba(0, 217, 255, 0.15);
    outline: none;
}

/* Dropdown options styling */
.form-group select option {
    background: #1a1f2e;
    color: #ffffff;
    padding: 12px;
    font-weight: 500;
}

/* For browsers that support it */
.form-group select option:hover {
    background: #2a3548;
}

.form-group select option:checked {
    background: linear-gradient(145deg, #00D9FF, #0099cc);
    color: #ffffff;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #00D9FF;
    background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 20, 30, 0.95));
    box-shadow: 0 0 0 4px rgba(0, 217, 255, 0.15), 0 4px 12px rgba(0, 217, 255, 0.2);
}

.form-group input::placeholder,
.form-group select::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
}

.team-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.team-box {
    background: rgba(20, 25, 35, 0.6);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.team-box.team1 {
    border-left: 3px solid #00D9FF;
}

.team-box.team2 {
    border-left: 3px solid #FF6B35;
}

.player-entry {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    margin-bottom: 12px;
    align-items: start;
    padding: 16px;
    background: linear-gradient(145deg, rgba(30, 35, 50, 0.8), rgba(20, 25, 40, 0.8));
    border-radius: 10px;
    border: 2px solid rgba(0, 217, 255, 0.1);
    transition: border-color 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.player-entry:hover {
    border-color: rgba(0, 217, 255, 0.2);
}

.player-inputs-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.player-input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.player-entry input {
    margin: 0;
    padding: 0 14px;
    background: linear-gradient(145deg, rgba(15, 20, 30, 0.9), rgba(10, 15, 25, 0.9));
    border: 2px solid rgba(0, 217, 255, 0.15);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    height: 46px;
    line-height: 46px;
}

.player-entry input:focus {
    border-color: #00D9FF;
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.15);
    background: linear-gradient(145deg, rgba(10, 15, 25, 0.95), rgba(5, 10, 20, 0.95));
}

.player-entry input::placeholder {
    color: rgba(255, 255, 255, 0.35);
    font-weight: 400;
}

.add-player-btn {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.2), rgba(0, 150, 200, 0.2));
    border: 2px solid #00D9FF;
    color: #00D9FF;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 12px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 217, 255, 0.15);
}

.add-player-btn:hover {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.3), rgba(0, 150, 200, 0.3));
}

.remove-player-btn {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(220, 80, 40, 0.2));
    border: 2px solid #FF6B35;
    color: #FF6B35;
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.15);
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.remove-player-btn:hover {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.3), rgba(220, 80, 40, 0.3));
}

.search-player-btn {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.2), rgba(0, 150, 200, 0.2));
    border: 2px solid #00D9FF;
    color: #00D9FF;
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    box-shadow: 0 2px 8px rgba(0, 217, 255, 0.15);
    flex-shrink: 0;
}

.search-player-btn:hover {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.3), rgba(0, 150, 200, 0.3));
}

.search-player-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.search-player-btn i {
    font-size: 16px;
}

.add-player-final-btn {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(56, 142, 60, 0.2));
    border: 2px solid #4CAF50;
    color: #4CAF50;
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
    flex-shrink: 0;
}

.add-player-final-btn:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3), rgba(56, 142, 60, 0.3));
}

.add-player-final-btn i {
    font-size: 16px;
}

.player-name-input[readonly] {
    background: linear-gradient(145deg, rgba(10, 15, 25, 0.9), rgba(5, 10, 20, 0.9));
    border-color: rgba(0, 217, 255, 0.3);
    cursor: not-allowed;
    color: rgba(255, 255, 255, 0.7);
}

.steam-id-input[readonly] {
    background: linear-gradient(145deg, rgba(10, 15, 25, 0.9), rgba(5, 10, 20, 0.9));
    border-color: rgba(0, 217, 255, 0.3);
    cursor: not-allowed;
    color: rgba(255, 255, 255, 0.7);
}

.map-selection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.map-option {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.map-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.map-option input[type="checkbox"]:checked + .map-image {
    border-color: #00D9FF;
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.5);
}

.map-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.map-option:hover .map-image {
    transform: scale(1.05);
    border-color: rgba(0, 217, 255, 0.5);
}

.map-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: white;
    padding: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
}

.map-order-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #00D9FF;
    color: #0a0e1a;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

.spectator-container {
    background: rgba(20, 25, 35, 0.6);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.spectator-entry input {
    border-color: rgba(156, 39, 176, 0.3);
}

.spectator-entry:hover {
    border-color: rgba(156, 39, 176, 0.4);
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-primary {
    flex: 1;
    padding: 15px;
    background: linear-gradient(135deg, #00D9FF, #0099cc);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 217, 255, 0.4);
}

.btn-secondary {
    flex: 1;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.json-preview {
    background: rgba(10, 14, 26, 0.9);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid rgba(0, 217, 255, 0.3);
    display: none;
}

.json-preview pre {
    color: #00D9FF;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    overflow-x: auto;
    margin: 0;
}

.cvars-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.cvar-entry {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: center;
}

.error-message {
    background: rgba(255, 107, 53, 0.2);
    border: 1px solid #FF6B35;
    color: #FF6B35;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
    display: none;
}

.success-message {
    background: rgba(0, 217, 255, 0.2);
    border: 1px solid #00D9FF;
    color: #00D9FF;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
    display: none;
}

.player-count-badge {
    display: inline-block;
    background: rgba(0, 217, 255, 0.2);
    color: #00D9FF;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .match-setup-container {
        padding: 10px;
    }
    
    .setup-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .team-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .team-box {
        padding: 15px;
    }
    
    .map-selection {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .map-card {
        min-height: 120px;
    }
    
    .map-card img {
        max-height: 80px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 14px;
        font-size: 15px;
    }
    
    .player-entry {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .player-inputs-group {
        width: 100%;
    }
    
    .player-input-row {
        gap: 8px;
    }
    
    .search-player-btn,
    .add-player-final-btn,
    .remove-player-btn {
        width: 46px;
        min-width: 46px;
        padding: 12px;
    }
    
    .remove-player-btn {
        width: 100%;
        margin-top: 8px;
    }
    
    .cvars-container {
        grid-template-columns: 1fr;
    }
    
    .form-group input,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 14px;
    }
    
    /* Better spacing for mobile */
    .player-list {
        gap: 12px;
    }
    
    /* Stack spectator entries */
    .spectator-entry {
        grid-template-columns: 1fr;
    }
}