/* ==========================================================================
   SISTEMA DE QUADRAS ESPORTIVAS - CSS PADRONIZADO
   ========================================================================== */

/* ==========================================================================
   VARIÁVEIS CSS GLOBAIS
   ========================================================================== */
:root {
    /* Cores Principais */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    
    /* Escala de Cinzas */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Design Tokens */
    --border-radius: 16px;
    --border-radius-sm: 12px;
    --border-radius-lg: 20px;
    --border-radius-xl: 24px;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Transições */
    --menu-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease;
    --transition-normal: all 0.3s ease;
    --transition-slow: all 0.5s ease;
}

/* ==========================================================================
   RESET E CONFIGURAÇÕES BÁSICAS
   ========================================================================== */

/* Screen Reader Only - Acessibilidade */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
* {
    box-sizing: border-box;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
    scroll-behavior: smooth;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */
.page-wrapper {
    flex: 1 0 auto;
}

main.fade-in {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ==========================================================================
   NAVEGAÇÃO
   ========================================================================== */
.navbar {
    background: white;
    box-shadow: var(--shadow);
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--menu-transition);
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-weight: 700;
    color: var(--gray-900);
    transition: var(--transition-normal);
}

.navbar-brand:hover {
    color: var(--primary-color);
    transform: translateY(-1px);
}

.navbar-brand:hover img {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.navbar-brand img {
    height: 50px;
    width: auto;
    margin-right: 0.75rem;
    transition: var(--transition-normal);
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition-normal);
}

.hamburger-btn:hover {
    background: var(--gray-100);
}

.hamburger-line {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--gray-700);
    margin: 5px 0;
    transition: var(--transition-normal);
    border-radius: 2px;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.navbar-nav {
    display: flex;
    align-items: center;
}

.nav-link {
    color: var(--gray-600);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition-normal);
    position: relative;
    font-weight: 500;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition-normal);
    transform: translateX(-50%);
}

.nav-link:hover::before {
    width: 80%;
}

.nav-link:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.nav-item.active .nav-link {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    font-weight: 600;
}

.nav-item.active .nav-link::before {
    width: 80%;
}

/* ==========================================================================
   MENU MÓVEL
   ========================================================================== */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: white;
    z-index: 1000;
    transition: var(--transition-normal);
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.mobile-menu::-webkit-scrollbar {
    width: 6px;
}

.mobile-menu::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.mobile-menu::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.mobile-menu::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition-normal);
}

.mobile-menu-close:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.mobile-nav-item {
    border-bottom: 1px solid var(--gray-100);
}

.mobile-nav-item:hover {
    background: var(--gray-50);
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    padding: 1rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: var(--transition-normal);
    font-weight: 500;
}

.mobile-nav-link:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.mobile-nav-item.active .mobile-nav-link {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    font-weight: 600;
}

.mobile-nav-item.active {
    border-left: 3px solid var(--primary-color);
}

.mobile-user-info {
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
    margin-top: auto;
}

.mobile-menu-logo {
    height: 35px;
    width: auto;
}

.mobile-menu-title {
    font-weight: 600;
    color: var(--gray-800);
}

.mobile-user-icon {
    color: var(--primary-color);
}

.mobile-user-name {
    color: var(--gray-700);
    font-weight: 500;
}

/* ==========================================================================
   BOTÕES
   ========================================================================== */
.btn-modern {
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-primary-modern {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-primary-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
    text-decoration: none;
}

.btn-outline-modern {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline-modern:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.btn-modern.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-modern.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   CARDS E LAYOUTS
   ========================================================================== */
.card-modern {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: var(--transition-normal);
}

.card-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-hover {
    transition: var(--transition-normal);
}

@keyframes floatCard {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-up {
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================================================
   NOTIFICAÇÕES
   ========================================================================== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    z-index: 1001;
    transform: translateX(100%);
    transition: var(--transition-normal);
    max-width: 400px;
}

.notification.show {
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.notification-close {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--border-radius);
    transition: var(--transition-normal);
    margin-left: auto;
}

.notification-close:hover {
    color: var(--gray-600);
    background: var(--gray-100);
}

.notification-info {
    border-left: 4px solid var(--primary-color);
}

.notification-success {
    border-left: 4px solid var(--success-color);
}

.notification-warning {
    border-left: 4px solid var(--warning-color);
}

.notification-error {
    border-left: 4px solid var(--danger-color);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 1.15rem 0;
    padding-right: 100px;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--gray-600);
}

.footer-brand img {
    height: 40px;
    width: auto;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--gray-600);
    text-decoration: none;
    transition: var(--transition-normal);
}

.footer-link:hover {
    color: var(--primary-color);
}

/* ==========================================================================
   UTILITÁRIOS
   ========================================================================== */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
}

.dashboard-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   ACESSIBILIDADE E FOCUS
   ========================================================================== */
.nav-link:focus,
.btn-modern:focus,
.mobile-nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ==========================================================================
   DISPOSITIVOS TÁTEIS
   ========================================================================== */
.touch-device .btn-modern {
    min-height: 44px;
}

.touch-device .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
}

/* ==========================================================================
   JAVASCRIPT HABILITADO
   ========================================================================== */
.js-enabled .nav-link:focus,
.js-enabled .btn-modern:focus {
    outline: none;
}

/* ==========================================================================
   PREFERÊNCIAS DE REDUÇÃO DE MOVIMENTO
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   RESPONSIVIDADE
   ========================================================================== */
@media (max-width: 991px) {
    .hamburger-btn {
        display: block;
    }
    
    .navbar-collapse {
        display: none;
    }
    
    .navbar-brand {
        margin-right: 0;
    }
    
    .navbar-brand img {
        height: 45px;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 0.75rem;
    }
    
    .navbar-brand {
        font-size: 0.9rem;
    }
    
    .navbar-brand img {
        height: 40px;
    }
    
    .mobile-menu {
        width: 280px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-brand img {
        height: 35px;
    }
    
    .footer {
        padding-right: 80px;
    }
    
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

@media (max-width: 480px) {
    .mobile-menu {
        width: 100%;
        right: -100%;
    }
    
    .navbar-brand {
        font-size: 0.85rem;
    }
    
    .navbar-brand img {
        height: 35px;
    }
    
    .footer-brand img {
        height: 30px;
    }
    
    .footer {
        padding-right: 70px;
    }
    
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* ==========================================================================
   MODO ESCURO
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --gray-50: #0f172a;
        --gray-100: #1e293b;
        --gray-200: #334155;
        --gray-300: #475569;
        --gray-400: #64748b;
        --gray-500: #94a3b8;
        --gray-600: #cbd5e1;
        --gray-700: #e2e8f0;
        --gray-800: #f1f5f9;
        --gray-900: #f8fafc;
    }
    
    body {
        background-color: var(--gray-50);
        color: var(--gray-800);
    }
    
    .navbar {
        background: var(--gray-100);
    }
    
    .mobile-menu {
        background: var(--gray-100);
    }
    
    .mobile-nav-item {
        border-bottom-color: var(--gray-200);
    }
    
    .mobile-nav-item:hover {
        background: var(--gray-200);
    }
    
    .mobile-user-info {
        border-top-color: var(--gray-200);
    }
}

/* ==========================================================================
   ESTILOS ESPECÍFICOS DO SISTEMA
   ========================================================================== */
.botoes-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

.quadras-root {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quadras-root > div {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#root > div {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

#root > div > div {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.quadras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.quadra-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: var(--transition-normal);
    border: 1px solid var(--gray-200);
}

.quadra-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 1100px) {
    .quadras-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 800px) {
    .quadras-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 500px) {
    .quadras-grid {
        grid-template-columns: 1fr;
        padding: 0.5rem;
    }
}

/* Removida a regra .row-cols-1 que estava sobrescrevendo o Bootstrap */

.contador-tempo {
    font-weight: 600;
}

.lista-espera {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--border-radius);
}

.btn-cancelar {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-cancelar:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-cancelar:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-add {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-add:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-add:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: var(--border-radius);
    border-bottom-left-radius: var(--border-radius);
}

.btn-group .btn:last-child {
    border-top-right-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
}

.hover-enabled .nav-link:hover {
    transform: translateY(-1px);
}

.hover-enabled .btn-modern:hover {
    transform: translateY(-2px);
}

.stat-card,
.stat-card:hover,
.stat-card:focus {
    transition: var(--transition-normal);
}

.stat-card:hover,
.stat-card:focus {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   BOTÃO FLUTUANTE DO WHATSAPP
   ========================================================================== */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    animation: whatsappPulse 2s infinite;
}

.whatsapp-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 28px;
}

.whatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
    color: white;
    text-decoration: none;
}

.whatsapp-button:active {
    transform: scale(0.95);
}

@keyframes whatsappPulse {
    0% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.6);
    }
    100% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
}

/* Responsividade para dispositivos móveis */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 15px;
        right: 15px;
    }
    
    .whatsapp-button {
        width: 55px;
        height: 55px;
        font-size: 24px;
    }
}

/* Modo escuro */
@media (prefers-color-scheme: dark) {
    .whatsapp-button {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.5);
    }
    
    .whatsapp-button:hover {
        box-shadow: 0 6px 20px rgba(37, 211, 102, 0.7);
    }
}