@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;700;800&family=Work+Sans:wght@400;500;600&display=swap');

:root {
    /* Light Theme (Digital Caddie) */
    --surface: #f7f9fb;
    --surface-low: #f2f4f6;
    --surface-lowest: #ffffff;
    --surface-container: #e6e8ea;

    --primary: #578061;
    /* Moss Green */
    --primary-container: #3a5541;
    --on-primary: #ffffff;

    --accent: #6a7b6c;
    --on-surface: #1a1c1a;
    --on-surface-variant: #434944;

    --danger: #491e28;
    --danger-container: #6d222f;
    /* Mahogany */
    --success: #578061;
    --warning: #f59e0b;

    --font-headline: 'Manrope', sans-serif;
    --font-body: 'Work Sans', sans-serif;

    --transition-speed: 0.4s;
    --border-radius-md: 0.5rem;
    /* Moderate (8px) */
    --shadow-sunken: 0px 12px 32px rgba(25, 28, 30, 0.04);
}

[data-theme='dark'] {
    --surface: #121412;
    --surface-low: #1a1c1a;
    --surface-lowest: #0c0d0c;
    --surface-container: #222422;
    --surface-container-high: #2d302d;

    --primary: #578061;
    --primary-container: #3a5541;
    --on-primary: #ffffff;
    --on-primary-container: #b8ccbf;

    --secondary: #6a7b6c;
    --secondary-container: #455046;

    --on-surface: #e2e3e1;
    --on-surface-variant: #c5c7c4;

    --shadow-sunken: 0px 8px 16px #0c0d0c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--surface);
    color: var(--on-surface);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Glassmorphism Classes */
.glass {
    background: var(--surface);
    opacity: 1;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transition: all var(--transition-speed);
}

#player-form {
    padding-top: 2rem
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-headline);
    color: var(--on-surface);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.display-lg {
    font-size: 3.5rem;
    line-height: 1.1;
}

.display-sm {
    font-size: 2.25rem;
    line-height: 1.2;
}

.headline-md {
    font-size: 1.75rem;
}

.title-md {
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-weight: 600;
}

.body-md {
    font-size: 0.875rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--accent);
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

nav {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0;

}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.75rem;
    font-family: var(--font-headline);
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--on-surface);
    font-weight: 600;
    font-size: 0.938rem;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    border-radius: var(--border-radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-speed);
    border: none;
    gap: 0.625rem;
    font-family: inherit;
    font-size: 0.875rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-container));
    color: var(--on-primary);
}

.btn-primary:hover {
    filter: brightness(1.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 53, 39, 0.2);
}

.btn-secondary {
    background-color: var(--surface-container);
    color: var(--on-surface);
}

.btn-secondary:hover {
    background-color: var(--surface-low);
}


.btn-danger {
    background-color: var(--danger);
    color: var(--on-surface);
}

.btn-danger:hover {
    background-color: var(--danger-container);
}

.btn-tertiary {
    background: transparent;
    color: var(--primary);
    padding-left: 0;
    padding-right: 0;
}

.btn-tertiary:hover {
    text-decoration: underline;
}

.btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: 0.813rem;
}

/* Cards */
.card {
    background-color: var(--surface-lowest);
    border-radius: 1rem;
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-sunken);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

/* Forms */
.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.625rem;
    color: var(--on-surface-variant);
    font-weight: 600;
    font-size: 0.813rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tonal-section {
    padding-top: 2rem;
}

.form-control {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--surface-low);
    border: none;
    border-radius: var(--border-radius-md);
    color: var(--on-surface);
    outline: none;
    font-family: var(--font-body);
    transition: all var(--transition-speed);
}

.form-control:focus {
    background: var(--surface-lowest);
    box-shadow: 0 0 0 1px var(--primary);
}

/* Tables - strictly forbid divider lines */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
    /* Whitespace between items */
    margin: 1.5rem 0;
}

th {
    text-align: left;
    padding: 1.5rem 1.25rem 1rem;
    color: var(--on-surface-variant);
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    opacity: 0.8;
}

thead {
    background-color: transparent;
}

td {
    padding: 1.25rem;
    background-color: var(--surface-low);
    transition: background-color var(--transition-speed);
}

td:first-child {
    border-radius: 0.75rem 0 0 0.75rem;
}

td:last-child {
    border-radius: 0 0.75rem 0.75rem 0;
}

tr:hover td {
    background-color: var(--surface-low);
}

/* Utility Classes */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.items-center {
    align-items: center;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

.gap-4 {
    gap: 1.5rem;
}

.w-5 {
    width: 1.25rem;
    text-align: center;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-5 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.m-0 {
    margin: 0;
}

.p-1 {
    padding: 0.25rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 1rem;
}

.p-4 {
    padding: 1.5rem;
}

.p-5 {
    padding: 2rem;
}

.small {
    font-size: 0.875rem;
}

.max-w-sm {
    max-width: 400px;
    width: 100%;
}

.max-w-md {
    max-width: 600px;
    width: 100%;
}

.max-w-lg {
    max-width: 800px;
    width: 100%;
}

.max-w-xl {
    max-width: 1000px;
    width: 100%;
}


/* Dashboard Cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.tournament-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .tournament-grid {
        grid-template-columns: 1fr;
    }
}

.tournament-card {
    position: relative;
    overflow: hidden;
}

.tournament-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.tournament-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.tournament-card.aberto::before {
    background: var(--success-color);
}

.tournament-card.rascunho::before {
    background: var(--text-muted);
}

.tournament-card.em_andamento::before {
    background: var(--warning-color);
}

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

.stat-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade {
    animation: fadeIn 0.5s ease forwards;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 99999;
    display: none;
    overflow-y: auto;
    padding: 40px 20px;
    align-items: flex-start;
    justify-content: center;
}

.modal-content {
    position: relative;
    width: 100%;
    background-color: var(--surface-container);
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 40px;
}

.modal-header-premium {
    padding: 30px 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.modal-footer-premium {
    padding: 30px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    background: rgba(255, 255, 255, 0.02);
}

.modal-open {
    overflow: hidden !important;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Grid adjustments */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gap-6 {
    gap: 1.5rem;
}

.col-span-2 {
    grid-column: span 2 / span 2;
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.hidden {
    display: none !important;
}

/* Modal and Positioning Utilities */
.fixed {
    position: fixed !important;
}

.absolute {
    position: absolute !important;
}

.relative {
    position: relative !important;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.z-50 {
    z-index: 50 !important;
}

.z-100 {
    z-index: 100 !important;
}

.z-9999 {
    z-index: 9999 !important;
}

/* Backdrop & Blurring Utilities */
.bg-black-80 {
    background: rgba(0, 0, 0, 0.8) !important;
}

.bg-black-90 {
    background: rgba(0, 0, 0, 0.9) !important;
}

.backdrop-blur-sm {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.backdrop-blur-md {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Animation Utility Classes */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-zoom-in {
    animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.transition-all {
    transition: all 0.3s ease;
}

.opacity-0 {
    opacity: 0;
}

.opacity-1 {
    opacity: 1;
}

/* Estilos Premium para o Modal Financeiro (Vanilla CSS) */
.financeiro-modal-container {
    display: flex;
    flex-direction: column;
    color: #fff;
}

.financeiro-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    min-height: 500px;
}

.financeiro-col-left {
    padding: 40px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.financeiro-col-right {
    background: rgba(0, 0, 0, 0.2);
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.financeiro-section-title {
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 20px;
    display: block;
}

.financeiro-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 15px;
    transition: all 0.2s;
}

.financeiro-card:focus-within {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-color);
}

.financeiro-label {
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 6px;
    display: block;
}

.financeiro-input {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    outline: none;
    padding: 0;
}

.financeiro-input::placeholder {
    color: rgba(255, 255, 255, 0.1);
}

.financeiro-select {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    outline: none;
    padding: 0;
    cursor: pointer;
}

.financeiro-select option {
    background: #111827;
    color: #fff;
}

/* Grid de Adição */
.add-product-container {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 30px 40px;
}

.add-row-top {
    margin-bottom: 15px;
}

.add-row-bottom {
    display: grid;
    grid-template-columns: 80px 1fr 120px;
    gap: 12px;
}

.btn-financeiro-add {
    background: var(--success-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.btn-financeiro-add:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.3);
}

.btn-financeiro-add:active {
    transform: translateY(0);
}

.payment-method-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.payment-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.payment-option input {
    display: none;
}

.payment-option i {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
}



.payment-option span {
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.2);
}

/* Estados Selecionados */
.payment-option input:checked+i.fa-pix {
    color: #32BCAD;
}

.payment-option input:checked+i.fa-barcode {
    color: var(--warning-color);
}

.payment-option input:checked+i.fa-credit-card {
    color: var(--info-color);
}

.payment-option input:checked~span {
    color: #fff;
}

.payment-option:has(input:checked) {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

/* Itens Lista */
.item-recorrente-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.item-recorrente-row:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.item-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.3);
}

.btn-item-remove {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.1);
    color: rgba(239, 68, 68, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
}

.item-recorrente-row:hover .btn-item-remove {
    opacity: 1;
}

/* Animações */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-modal-premium {
    animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}