/**
 * AppGamefy - Admin Custom Styles
 * Estilos customizados para o painel administrativo
 */

/* Variaveis de cores */
:root {
    --primary-color: #1e40af;
    --primary-hover: #1e3a8a;
    --secondary-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
}

/* Fonte base */
body {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Sidebar */
.sidebar {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--dark-color) 100%);
}

.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-left: 3px solid var(--secondary-color);
}

/* Cards */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}

/* Stat Cards */
.stat-card {
    border-left: 4px solid var(--primary-color);
}

.stat-card.success {
    border-left-color: var(--success-color);
}

.stat-card.warning {
    border-left-color: var(--warning-color);
}

.stat-card.danger {
    border-left-color: var(--danger-color);
}

.stat-card.info {
    border-left-color: var(--info-color);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
}

.stat-card .stat-label {
    color: #6b7280;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Botoes */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Tabelas */
.table {
    margin-bottom: 0;
}

.table tbody tr:hover {
    background-color: #f9fafb;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
}

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.form-label {
    font-weight: 500;
    color: #374151;
}

/* Alertas */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Paginacao */
.pagination .page-link {
    border: none;
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    color: white;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: #9ca3af;
}

/* Modal */
.modal-header {
    border-bottom: 1px solid #e5e7eb;
}

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

/* Dropdown */
.dropdown-menu {
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
}

/* Tooltip customizado */
.tooltip-inner {
    background-color: var(--dark-color);
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-lg {
    width: 64px;
    height: 64px;
}

/* Status indicators */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background-color: var(--success-color);
}

.status-dot.offline {
    background-color: #9ca3af;
}

.status-dot.away {
    background-color: var(--warning-color);
}

/* Data table actions */
.table-actions {
    white-space: nowrap;
}

.table-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Sidebar scroll fix */
.app-sidebar {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.app-sidebar .sidebar-brand {
    flex-shrink: 0;
}

.app-sidebar .sidebar-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.app-sidebar .sidebar-wrapper::-webkit-scrollbar {
    width: 6px;
}

.app-sidebar .sidebar-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.app-sidebar .sidebar-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.app-sidebar .sidebar-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

/* Table thead visibility fix */
.table-responsive {
    overflow-x: auto;
    overflow-y: visible;
    margin-top: 0 !important;
}

.card .table-responsive {
    border-radius: 0 0 0.75rem 0.75rem;
}

.card .card-body + .table-responsive {
    margin-top: -1rem;
}

.card .table-responsive .table {
    margin-bottom: 0;
}

.table thead {
    position: relative;
    z-index: 2;
}

.table thead th {
    background-color: #f9fafb !important;
    border-bottom: 2px solid #e5e7eb !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #6b7280;
    white-space: nowrap;
    vertical-align: middle;
}

/* Fix para evitar sobreposicao do tbody sobre thead */
.table tbody {
    position: relative;
    z-index: 1;
}

.table tbody tr:first-child td {
    border-top: none;
}

/* Fix para card com table - evitar overlap do header com thead */
.card > .table-responsive,
.card-body > .table-responsive {
    border-top: none;
}

/* Remover padding excessivo do card-body quando tem tabela */
.card-body.p-0 .table thead th:first-child {
    padding-left: 1rem;
}

.card-body.p-0 .table tbody td:first-child {
    padding-left: 1rem;
}

.card-header + .card-body .table thead th,
.card-header + .table-responsive .table thead th {
    border-top: none;
}

/* Garantir visibilidade do thead quando tem filtros acima */
.card-body .row + .table-responsive {
    margin-top: 1rem;
}

.card-body .mb-3 + .table-responsive,
.card-body .mb-4 + .table-responsive {
    margin-top: 0;
}

/* Fix adicional para thead com table-light */
.table thead.table-light th {
    background-color: #f9fafb !important;
}
