/* Pelada Manager - Mobile First CSS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Reset e configurações globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f4f8;
    line-height: 1.6;
    color: #333;
}

/* Container principal */
.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
.header {
    text-align: center;
    margin: 2rem 0;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1d4ed8;
    margin-bottom: 0.5rem;
}

.header p {
    color: #6b7280;
    font-size: 1rem;
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    width: 100%;
    margin-bottom: 0.5rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background-color: #1d4ed8;
    color: white;
}

.btn-primary:hover {
    background-color: #1e40af;
}

.btn-secondary {
    background-color: #059669;
    color: white;
}

.btn-secondary:hover {
    background-color: #047857;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-warning {
    background-color: #d97706;
    color: white;
}

.btn-warning:hover {
    background-color: #b45309;
}

.btn-organizer {
    background-color: #7c3aed;
    color: white;
}

.btn-organizer:hover {
    background-color: #6d28d9;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    width: auto;
    margin: 0;
}

/* Inputs */
.input-field {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s ease;
}

.input-field:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

.input-field::placeholder {
    color: #9ca3af;
}

/* Cards */
.card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

/* Listas de jogadores */
.player-list {
    background: #f9fafb;
    border-radius: 0.5rem;
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.player-name {
    font-weight: 500;
    color: #374151;
}

.player-phone {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Estilo para itens na lista de suplentes */
.bench-item {
    background-color: rgba(139, 92, 246, 0.05); /* Fundo levemente roxo */
    border-left: 3px solid #8b5cf6;
}

.bench-confirmed-at {
    margin-top: 0.25rem;
    font-style: italic;
}

/* Times */
.team-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.team {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    border: 2px solid #e5e7eb;
}

.team-a {
    border-color: #3b82f6; /* Azul */
}

.team-b {
    border-color: #f97316; /* Laranja */
}

.team-c {
    border-color: #64748b; /* Branco */
}

.team-d {
    border-color: #1e293b; /* Preto */
}

.team-e {
    border-color: #15803d; /* Verde */
}

.team h4 {
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-align: center;
    padding: 0.5rem;
    border-radius: 0.25rem;
}

.team-a h4 {
    background-color: #dbeafe;
    color: #1e40af; /* Azul */
}

.team-b h4 {
    background-color: #ffedd5;
    color: #c2410c; /* Laranja */
}

.team-c h4 {
    background-color: #f1f5f9;
    color: #475569; /* Branco */
}

.team-d h4 {
    background-color: #cbd5e1;
    color: #0f172a; /* Preto */
}

.team-e h4 {
    background-color: #dcfce7;
    color: #166534; /* Verde */
}

.team-player {
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    background: #f9fafb;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    text-align: center;
}

/* Botões de seleção de times */
.team-buttons {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.team-buttons .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    font-weight: 500;
    transition: all 0.2s;
}

.team-buttons .btn-sm:hover {
    background-color: #e5e7eb;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-confirmed {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-checked-in {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-team-a {
    background-color: #dbeafe;
    color: #1e40af; /* Azul */
}

.badge-team-b {
    background-color: #ffedd5;
    color: #c2410c; /* Laranja */
}

.badge-team-c {
    background-color: #f1f5f9;
    color: #475569; /* Branco */
}

.badge-team-d {
    background-color: #cbd5e1;
    color: #0f172a; /* Preto */
}

.badge-team-e {
    background-color: #dcfce7;
    color: #166534; /* Verde */
}

/* Badge Organizador */
.badge-organizer {
    background-color: #f59e0b;
    color: #fff;
    font-size: 0.7rem;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

/* Badge Suplente */
.badge-bench {
    background-color: #8b5cf6; /* Cor roxa */
    color: #fff;
    font-size: 0.7rem;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

/* Badge Jogador Promovido */
.badge-promoted {
    background-color: #059669; /* Verde esmeralda */
    color: #fff;
    font-size: 0.7rem;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    vertical-align: middle;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    overscroll-behavior: contain; /* Prevent scroll chain on modal */
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
}

.modal h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #374151;
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem 1rem;
}

.spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #1d4ed8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-green-600 { color: #059669; }
.text-red-600 { color: #dc2626; }
.text-blue-600 { color: #2563eb; }

/* Footer */
.footer {
    text-align: center;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 2rem;
    padding-bottom: 1rem;
}

/* Responsividade para tablets */
@media (min-width: 768px) {
    .container {
        max-width: 600px;
        padding: 2rem;
    }
    
    .header h1 {
        font-size: 3rem;
    }
    
    .team-container {
        gap: 1.5rem;
    }
    
    .btn {
        width: auto;
        min-width: 200px;
    }
}

/* Responsividade para desktop */
@media (min-width: 1024px) {
    .container {
        max-width: 800px;
    }
    
    .card {
        padding: 2rem;
    }
}

/* Custom scrollbar */
.player-list::-webkit-scrollbar {
    width: 8px;
}

.player-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.player-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.player-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Animações */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* PWA e Mobile optimizations */
.container {
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom);
}

/* Touch-friendly elements */
.btn, .input-field, .player-item {
    min-height: 44px;
}

/* Focus states for accessibility */
.btn:focus,
.input-field:focus {
    outline: 2px solid #1d4ed8;
    outline-offset: 2px;
}
