/* Main layout styles */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    padding-top: 35px; /* Espaço reduzido para o cabeçalho fixo */
}

/* Navbar brand responsivo */
.navbar-brand {
    font-size: 1.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Título do navbar com cor dinâmica */
#navbar-title {
    transition: color 0.3s ease;
    /* Cor inicial branca, será alterada pelo JavaScript */
    color: #ffffff;
}

/* Responsividade para tablets */
@media (max-width: 992px) {
    /* Títulos um pouco menores em tablets */
    h1 {
        font-size: 1.6rem !important;
    }
    
    h2 {
        font-size: 1.4rem !important;
    }
    
    h3 {
        font-size: 1.3rem !important;
    }
    
    /* Botões responsivos para tablets */
    .btn-mobile-responsive {
        padding: 0.375rem 0.625rem;
        font-size: 0.9rem;
    }
    
    .btn-mobile-responsive .btn-text {
        display: inline;
    }
}

/* Responsividade para o texto do cabeçalho */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 0.9rem;
        max-width: 80%;
    }
    
    .navbar-brand span {
        display: inline-block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Títulos menores em mobile */
    h1 {
        font-size: 1.4rem !important;
    }
    
    h2 {
        font-size: 1.25rem !important;
    }
    
    h3 {
        font-size: 1.15rem !important;
    }
    
    /* Botões responsivos para mobile - texto reduzido */
    .btn-mobile-responsive {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .btn-mobile-responsive .btn-text {
        display: none !important;
    }
    
    /* Margem dos ícones reduzida */
    .btn-mobile-responsive .fas, 
    .btn-mobile-responsive .fa {
        margin-right: 0.125rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 0.8rem;
        max-width: 70%;
    }
    
    .navbar-brand span {
        white-space: normal;
        line-height: 1.2;
    }
    
    /* Títulos menores em mobile */
    h1 {
        font-size: 1.3rem !important;
    }
    
    h2 {
        font-size: 1.2rem !important;
    }
    
    h3 {
        font-size: 1.1rem !important;
    }
    
    h4, h5 {
        font-size: 1rem !important;
    }
    
    /* Botões mais compactos em mobile */
    .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .btn-lg {
        padding: 0.375rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .btn-sm {
        padding: 0.125rem 0.375rem;
        font-size: 0.8rem;
    }
    
    /* Botões de ação específicos para mobile - reduzir texto e manter ícones */
    .btn .fas, .btn .fa {
        margin-right: 0.25rem;
    }
    
    /* Ocultar texto em botões menores mantendo apenas ícones */
    .btn-mobile-icon-only .btn-text {
        display: none;
    }
    
    /* Container de botões mais compacto */
    .d-flex .btn + .btn {
        margin-left: 0.25rem;
    }
    
    /* Breadcrumb menor */
    .breadcrumb {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }
    
    /* Cards com padding reduzido */
    .card-body {
        padding: 0.75rem;
    }
    
    .card-header {
        padding: 0.5rem 0.75rem;
    }
    
    /* Tabelas responsivas */
    .table-responsive {
        border: none;
    }
    
    .table th, .table td {
        padding: 0.375rem;
        font-size: 0.875rem;
    }
    
    /* Container fluido para evitar overflow horizontal */
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Ajustes para flexbox em mobile */
    .d-flex .btn-group {
        flex-wrap: wrap;
    }
    
    .btn-group > .btn {
        flex-shrink: 0;
    }
    
    /* Cards mais compactos */
    .card {
        border-radius: 0.375rem;
    }
    
    /* Texto overflow em badges */
    .badge {
        font-size: 0.75rem;
        padding: 0.25em 0.4em;
    }
    
    /* Melhor quebra de texto em mobile */
    .text-wrap {
        word-break: break-word;
    }
    
    /* Botões de toggle menores */
    .btn-group .btn-outline-secondary {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* Estilos para a tela de registro de ações */
.player-zone.player-selected {
    background-color: rgba(13, 110, 253, 0.15);
    border-radius: 8px;
    box-shadow: 0 0 0 2px #0d6efd;
    transition: all 0.2s ease-in-out;
}

/* Realce quando uma ação está sendo arrastada sobre um jogador */
.player-zone.drag-over {
    background-color: rgba(25, 135, 84, 0.15);
    border-radius: 8px;
    box-shadow: 0 0 0 2px #198754;
    transition: all 0.2s ease-in-out;
}

/* Estilo quando uma ação está sendo arrastada */
.action-card.dragging {
    opacity: 0.7;
    transform: scale(1.05);
}

/* Wrapper for sidebar and content */
.wrapper {
    display: flex;
    flex: 1;
}

/* Sidebar styles */
.sidebar {
    width: 290px;
    background-color: #212529; /* Cor padrão, será substituída pelo JS */
    color: #fff;
    transition: all 0.3s;
    position: fixed;
    top: 35px; /* Ajustado para nova altura do header */
    bottom: 0;
    left: 0;
    z-index: 100;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

/* Sidebar logo container */
.sidebar-logo-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

/* Sidebar logo - Estilo circular igual ao Portal do Responsável */
.sidebar-logo {
    max-width: 80px;
    max-height: 80px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid #3498db;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.sidebar-logo:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    border-color: #fff !important;
}

/* Nome do clube no sidebar */
.sidebar-clube-nome {
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #000000;
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    word-wrap: break-word;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Tema escuro para o menu lateral (padrão) */
.sidebar.dark-theme {
    color: #fff;
}
.sidebar.dark-theme .sidebar-section-header {
    color: #e9ecef;
    background-color: rgba(0, 0, 0, 0.2);
}
.sidebar.dark-theme .sidebar-section-header:hover {
    background-color: rgba(0, 0, 0, 0.3);
}
.sidebar.dark-theme .nav-link {
    color: #adb5bd;
}
.sidebar.dark-theme .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.2);
    color: #fff;
}

/* Tema claro para o menu lateral (quando cores claras são escolhidas) */
.sidebar.light-theme {
    color: #212529;
}
.sidebar.light-theme .sidebar-section-header {
    color: #212529;
    background-color: rgba(0, 0, 0, 0.1);
}
.sidebar.light-theme .sidebar-section-header:hover {
    background-color: rgba(0, 0, 0, 0.15);
}
.sidebar.light-theme .nav-link {
    color: #495057;
}
.sidebar.light-theme .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #212529;
}

.sidebar.collapsed {
    margin-left: -290px;
}

.sidebar-sticky {
    padding: 20px 0;
}

/* Sidebar sections */
.sidebar-section {
    margin-bottom: 10px;
}

.sidebar-section-header {
    padding: 10px 15px;
    font-weight: 600;
    color: #e9ecef;
    cursor: pointer;
    display: flex;
    align-items: center;
    background-color: #343a40;
    border-radius: 5px;
    margin: 0 10px;
}

.sidebar-section-header:hover {
    background-color: #495057;
}

.sidebar-section-content {
    padding: 0;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-section.collapsed .sidebar-section-content {
    max-height: 0;
}

.sidebar-section.collapsed .sidebar-section-header i.fa-chevron-down {
    transform: rotate(-90deg);
}

.sidebar-section-header i.fa-chevron-down {
    transition: transform 0.3s ease;
}

/* Navbar styles */
.navbar {
    padding: 0.1rem 1rem; /* Padding aumentado para acomodar o botão */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1030;
    min-height: 35px; /* Altura aumentada para mostrar botão do menu */
}

.navbar-brand {
    font-size: 0.9rem; /* Fonte menor para desktop */
    line-height: 1;
    margin: 0;
}

.navbar-toggler {
    padding: 0.2rem; /* Botão menor */
    font-size: 0.8rem;
    margin: 0;
}

/* Navbar mobile - altura aumentada para mostrar botão */
@media (max-width: 768px) {
    .navbar {
        min-height: 22px; /* Altura aumentada para acomodar botão do menu */
        padding: 0.05rem 0.3rem; /* Padding aumentado em mobile */
    }
    
    .navbar-brand {
        font-size: 0.7rem; /* Fonte ligeiramente maior para mobile */
        line-height: 1.2;
        margin: 0;
        padding: 0;
    }
    
    .navbar-toggler {
        padding: 0.15rem; /* Botão com mais padding */
        font-size: 0.8rem;
        margin: 0;
        width: 24px;
        height: 20px;
    }
    
    .navbar-toggler-icon {
        width: 14px;
        height: 12px;
        font-size: 0.7rem;
    }
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.1rem; /* Ligeiramente reduzido para nova altura */
}

.navbar-toggler {
    border: none;
    padding: 0.3rem; /* Reduzido para nova altura */
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    transition: background-color 0.3s;
}

.navbar-toggler:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Sempre mostrar o botão do sidebar */
.navbar-toggler {
    display: block !important;
}

/* Overlay para dispositivos móveis */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: block;
}

/* Melhorar responsividade para telas pequenas */
@media (max-width: 576px) {
    .main-content {
        padding: 10px;
    }
    
    .card {
        margin-bottom: 15px;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .form-control {
        font-size: 0.875rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .card-header {
        padding: 0.5rem 0.75rem;
    }
    
    .progress {
        height: 15px !important;
        font-size: 0.75rem;
    }
    
    .badge {
        font-size: 0.75rem;
    }
    
    .btn-group .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .h1, .h2, .h3 {
        font-size: 1.5rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .nav-link {
        font-size: 0.875rem;
    }
}

/* Melhorar o comportamento do sidebar em telas pequenas */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        width: 280px;
        height: 100vh;
        top: 0;
        left: -280px;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .main-content {
        width: 100%;
        margin-left: 0;
        transition: none;
    }
}

/* Main content styles */
.main-content {
    flex: 1;
    padding: 20px;
    margin-left: 290px;
    margin-top: 60px; /* Aumentado para evitar sobreposição do cabeçalho */
    transition: all 0.3s;
}

.main-content.collapsed {
    margin-left: 0;
}

.main-content.with-sidebar {
    margin-left: 290px;
}

@media (max-width: 768px) {
    .sidebar {
        margin-left: -290px;
        z-index: 1050; /* Maior que o header para aparecer por cima */
    }
    .sidebar.show {
        margin-left: 0;
        box-shadow: 0 0 10px rgba(0,0,0,0.3);
    }
    .main-content {
        margin-left: 0;
    }
    .main-content.with-sidebar {
        margin-left: 0;
    }
}

/* Navigation */
.sidebar .nav-link {
    padding: 0.6rem 1rem;
    margin: 3px 10px;
    color: #adb5bd;
    border-radius: 5px;
    transition: all 0.2s;
    line-height: 1.3;
    font-size: 0.95rem;
}

.sidebar .nav-link:hover {
    background-color: #495057;
    color: #fff;
}

.sidebar .nav-link.active {
    background-color: #007bff;
    color: #fff;
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Footer styles */
footer {
    margin-top: auto;
    border-top: 1px solid #dee2e6;
}

/* Personalizações do menu de usuário */
.dropdown-menu .form-control-color {
    width: 100%;
    height: 40px;
    padding: 2px;
    margin-top: 5px;
}

/* Card components */
.card {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

/* Form elements */
.form-control {
    border-radius: 6px;
    border: 1px solid #ddd;
}

.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn {
    border-radius: 6px;
    font-weight: 500;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

/* Table styles */
.table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table th {
    background-color: #f8f9fa;
    border-top: none;
    font-weight: 600;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Força cor preta em todas as células de tabela */
.table td,
.table th,
.table tbody tr td,
.table thead tr th,
.table td *:not(.badge),
.table th *:not(.badge) {
    color: #000 !important;
}

/* Força cor preta em texto forte */
.table td strong,
.table th strong {
    color: #000 !important;
}

/* Manter cores dos badges */
.table .badge {
    color: inherit !important;
}

/* Badges */
.badge {
    padding: 0.4em 0.6em;
    font-weight: 500;
    border-radius: 4px;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Tabs */
.nav-tabs .nav-link {
    border-radius: 6px 6px 0 0;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    border-color: #dee2e6 #dee2e6 #fff;
    font-weight: 600;
}

/* Modals */
.modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 1px solid #f0f0f0;
}

.modal-footer {
    border-top: 1px solid #f0f0f0;
}

/* Custom styles for specific components */
.player-card {
    height: 100%;
}

.player-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

.player-stats {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.action-count {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
}

.filter-section {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Espaçamento adicional para conteúdo geral para evitar sobreposição com o header */
.container, .container-fluid {
    padding-top: 15px; /* Reduzido para compensar cabeçalho menor */
}

/* Ajuste para páginas que já têm a classe main-content */
.main-content .container, .main-content .container-fluid {
    padding-top: 0; /* Remove o padding extra se já está dentro de main-content */
}

/* Regra específica para dispositivos móveis */
@media (max-width: 768px) {
    body {
        padding-top: 20px; /* Muito reduzido para cabeçalho mobile */
    }
    
    .container, .container-fluid {
        padding-top: 10px; /* Muito reduzido para cabeçalho mobile */
    }
    
    .main-content {
        margin-top: 20px; /* Muito reduzido para cabeçalho mobile */
    }
    
    .sidebar {
        top: 15px; /* Ajustado para nova altura do cabeçalho mobile */
    }
}

/* Estilos para Ajuda Contextual */
#contextualHelpBtn {
    transition: all 0.3s ease;
}

#contextualHelpBtn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.help-section {
    margin-bottom: 20px;
}

.help-section h6 {
    color: #007bff;
    margin-bottom: 10px;
    font-weight: 600;
}

.help-section ul {
    margin-bottom: 10px;
}

.help-section li {
    margin-bottom: 5px;
}

.help-section strong {
    color: #495057;
}

.modal-body .help-section:last-child {
    margin-bottom: 0;
}

/* Responsividade do botão de ajuda */
@media (max-width: 768px) {
    #contextualHelpBtn {
        width: 50px;
        height: 50px;
        font-size: 20px;
        bottom: 15px;
        right: 15px;
    }
}