/**
 * Poker Moon Control - Estilos Principais
 * Mobile First Design
 */

:root {
    /* Poker Moon Color Palette - Expandida */
    /* Base Colors - Preto e Cinzas */
    --primary-color: #0a0a0a;
    --secondary-color: #1a1a1a;
    --tertiary-color: #2a2a2a;
    --gray-800: #1f1f1f;
    --gray-700: #2d2d2d;
    --gray-600: #404040;
    --gray-500: #525252;
    --gray-400: #737373;
    --gray-300: #a3a3a3;
    --gray-200: #d4d4d4;
    --gray-100: #e5e5e5;
    --gray-50: #fafafa;
    
    /* Accent Colors - Vermelho e variações */
    --accent-color: #dc2626;
    --accent-hover: #b91c1c;
    --accent-light: #ef4444;
    --accent-dark: #991b1b;
    --accent-soft: #fca5a5;
    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-200: #fecaca;
    
    /* Semantic Colors */
    --success-color: #10b981;
    --success-dark: #059669;
    --warning-color: #f59e0b;
    --warning-dark: #d97706;
    --danger-color: #dc2626;
    
    /* Text Colors - Melhor contraste */
    --text-primary: #ffffff;
    --text-primary-dark: #1a1a1a;
    --text-secondary: #525252;
    --text-secondary-dark: #2d2d2d;
    --text-muted: #737373;
    --text-muted-dark: #404040;
    
    /* Background Colors */
    --card-bg: #ffffff;
    --card-bg-dark: #1a1a1a;
    --card-bg-hover: #fafafa;
    
    /* Border Colors */
    --border-color: #e5e5e5;
    --border-color-dark: #404040;
    --border-color-medium: #d4d4d4;
    
    /* Shadows */
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-red: 0 4px 12px rgba(220, 38, 38, 0.3);
    --shadow-dark: 0 4px 12px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--tertiary-color) 0%, var(--secondary-color) 50%, var(--gray-800) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    padding: 0;
    margin: 0;
    position: relative;
}

/* Container Principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--gray-800) 100%);
    padding: 1.5rem 1rem;
    box-shadow: var(--shadow-dark);
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid var(--accent-color);
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
}

.header > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
}

.header img {
    max-height: 50px;
    height: auto;
    width: auto;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Navigation */
.nav {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.nav a {
    padding: 0.75rem 1.25rem;
    background: var(--accent-color);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.nav a:hover {
    background: #0d2952;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.nav a.active {
    background: var(--success-color);
}

[id^="tab"].active {
    background: var(--success-color) !important;
}

/* Cards */
.card {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--card-bg-hover) 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color-medium);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    color: var(--text-primary-dark);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-soft);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary-dark);
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 0.5rem;
}

/* Formulários */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary-dark);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color-medium);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary-dark);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--red-100);
    background: var(--card-bg);
}

.form-control::placeholder {
    color: #7f8c8d;
}

/* Botões */
.btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    width: 100%;
    margin-bottom: 0.5rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: var(--shadow-red);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.btn-secondary {
    background: #1a1a1a;
    color: var(--text-primary);
    border: 2px solid #404040;
}

.btn-secondary:hover:not(:disabled) {
    background: #2a2a2a;
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--text-primary);
}

.btn-danger:hover:not(:disabled) {
    background: #c0392b;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    width: auto;
    margin: 0 0.25rem;
}

/* Listas */
.list {
    list-style: none;
}

.list-item {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--card-bg-hover) 100%);
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    border-radius: 12px;
    border-left: 4px solid var(--accent-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    box-shadow: var(--shadow);
    color: var(--text-primary-dark);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-left-width 0.2s ease;
}

.list-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-lg);
    border-left-width: 6px;
}

.list-item-info {
    flex: 1;
    min-width: 200px;
}

.list-item-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary-dark);
}

.list-item-subtitle {
    color: var(--text-secondary-dark);
    font-size: 0.9rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.badge-success {
    background: var(--success-color);
    color: var(--text-primary);
}

.badge-warning {
    background: var(--warning-color);
    color: var(--text-primary);
}

.badge-danger {
    background: var(--danger-color);
    color: var(--text-primary);
}

.badge-info {
    background: var(--accent-color);
    color: var(--text-primary);
}

.badge-finished {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.badge-paid {
    background: linear-gradient(135deg, #16a085 0%, #138d75 100%);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(22, 160, 133, 0.3);
}

.badge-pending {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* Text Utilities */
.text-success {
    color: #16a085;
    font-weight: 600;
}

.text-error {
    color: var(--accent-color);
    font-weight: 600;
}

/* Grid */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    grid-template-columns: 1fr;
}

.grid-3 {
    grid-template-columns: 1fr;
}

/* Financial Summary */
.financial-summary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--gray-800) 100%);
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    border: 3px solid var(--accent-color);
    box-shadow: var(--shadow-lg), inset 0 0 20px rgba(220, 38, 38, 0.1);
}

.financial-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.financial-item:last-child {
    border-bottom: none;
    font-weight: 700;
    font-size: 1.25rem;
    padding-top: 1rem;
}

.financial-label {
    color: var(--gray-200);
    font-weight: 500;
}

.financial-value {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 1rem;
    background: linear-gradient(135deg, var(--tertiary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    border-left: 4px solid var(--accent-color);
    max-width: 300px;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    border-left-color: var(--danger-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

/* Search Bar */
.search-bar {
    margin-bottom: 1.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow-y: auto;
    padding: 1rem;
}

.modal.show {
    display: block;
}

.modal-content {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--card-bg-hover) 100%);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    margin: 2rem auto;
    box-shadow: var(--shadow-lg);
    border: 3px solid var(--accent-color);
    color: var(--text-primary-dark);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-close {
    background: var(--accent-color);
    border: 2px solid var(--accent-color);
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-weight: 700;
    line-height: 1;
}

.modal-close:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: scale(1.1);
}

.modal-close:active {
    transform: scale(0.95);
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted-dark);
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--card-bg) 100%);
    border-radius: 12px;
    border: 2px dashed var(--border-color-medium);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Tabs */
.tab-content {
    display: block;
}

/* Logo responsivo no header mobile */
@media (max-width: 767px) {
    body {
        font-size: 16px;
        -webkit-text-size-adjust: 100%;
    }
    
    .container {
        padding: 0.75rem;
    }
    
    .header {
        padding: 1rem 0.75rem;
        margin-bottom: 1rem;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    
    .header > div {
        flex-direction: column;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .header > div > div:last-child {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .header img {
        max-height: 40px;
    }
    
    .header h1 {
        font-size: 1.25rem;
    }
    
    /* Cards mobile */
    .card {
        padding: 1.25rem;
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    .card-title {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    /* Botões mobile - maiores e mais espaçados */
    .btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
        width: 100%;
        margin-bottom: 0.75rem;
        border-radius: 10px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn-small {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        min-height: 44px;
        margin: 0.25rem 0.25rem 0.5rem 0.25rem;
    }
    
    /* Lista mobile */
    .list-item {
        padding: 1rem;
        margin-bottom: 0.75rem;
        border-radius: 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .list-item-info {
        width: 100%;
        min-width: auto;
    }
    
    .list-item-title {
        font-size: 1rem;
    }
    
    .list-item-subtitle {
        font-size: 0.85rem;
    }
    
    /* Formulários mobile */
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-group label {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }
    
    .form-control {
        padding: 1rem;
        font-size: 16px; /* Previne zoom no iOS */
        min-height: 48px;
        border-radius: 10px;
        border-width: 2px;
    }
    
    /* Modal mobile - melhorado */
    .modal {
        padding: 0.5rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 1rem auto;
        max-width: calc(100% - 1rem);
        border-radius: 12px;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
        z-index: 1001;
    }
    
    /* Prevenir scroll no body quando modal aberto */
    body.modal-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
    
    .modal-header {
        margin-bottom: 1.25rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .modal-close {
        width: 48px;
        height: 48px;
        font-size: 1.75rem;
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        background: var(--accent-color);
        border: 2px solid var(--accent-color);
    }
    
    .modal-close:active {
        transform: scale(0.9);
    }
    
    /* Melhorar scroll do modal em mobile */
    .modal-content::-webkit-scrollbar {
        width: 6px;
    }
    
    .modal-content::-webkit-scrollbar-track {
        background: var(--gray-100);
        border-radius: 10px;
    }
    
    .modal-content::-webkit-scrollbar-thumb {
        background: var(--accent-color);
        border-radius: 10px;
    }
    
    .modal-content::-webkit-scrollbar-thumb:hover {
        background: var(--accent-hover);
    }
    
    /* Tabelas mobile - melhor visualização */
    table {
        font-size: 0.9rem;
        width: 100%;
        border-collapse: collapse;
        display: table;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        background: var(--card-bg);
        border-radius: 10px;
        box-shadow: var(--shadow);
    }
    
    table thead {
        display: table-header-group;
    }
    
    table tbody {
        display: table-row-group;
    }
    
    table tr {
        display: table-row;
        border-bottom: 1px solid var(--border-color);
    }
    
    table th {
        padding: 1rem 0.75rem;
        text-align: left;
        font-weight: 600;
        font-size: 0.85rem;
        min-height: 48px;
        display: table-cell;
        vertical-align: middle;
    }
    
    table td {
        padding: 1rem 0.75rem;
        min-height: 48px;
        display: table-cell;
        vertical-align: middle;
        word-break: break-word;
    }
    
    /* Para tabelas dentro de modais em mobile */
    .modal-content table {
        font-size: 0.85rem;
    }
    
    .modal-content table th,
    .modal-content table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    /* Badges mobile */
    .badge {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        margin-left: 0.25rem;
    }
    
    /* Financial Summary mobile */
    .financial-summary {
        padding: 1.25rem;
        border-radius: 12px;
    }
    
    .financial-item {
        padding: 0.875rem 0;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .financial-label {
        font-size: 0.9rem;
    }
    
    .financial-value {
        font-size: 1rem;
    }
    
    .financial-item:last-child {
        font-size: 1.1rem;
    }
    
    /* Navigation mobile */
    .nav {
        gap: 0.5rem;
        margin-top: 0.75rem;
    }
    
    .nav a {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Search bar mobile */
    .search-bar input {
        min-height: 48px;
        font-size: 16px;
        padding: 0.875rem;
    }
    
    /* Toast mobile */
    .toast {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        max-width: none;
        padding: 1rem;
    }
    
    /* Footer mobile */
    .footer {
        padding: 2rem 1rem;
        margin-top: 2rem;
    }
    
    .footer p {
        font-size: 0.85rem;
    }
    
    .footer .footer-brand {
        font-size: 1rem;
    }
    
    /* Empty state mobile */
    .empty-state {
        padding: 2rem 1rem;
    }
    
    .empty-state-icon {
        font-size: 2.5rem;
    }
}

/* Responsive */
@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .btn {
        width: auto;
        margin-right: 0.5rem;
        margin-bottom: 0;
    }
    
    .container {
        padding: 2rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header > div {
        flex-direction: row;
    }
}

@media (min-width: 1024px) {
    .grid-2 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--gray-800) 100%);
    padding: 2.5rem 1rem;
    margin-top: 4rem;
    text-align: center;
    border-top: 2px solid rgba(220, 38, 38, 0.4);
    color: var(--gray-300);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--gray-300);
}

.footer .footer-brand {
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #e5e5e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-left: 0.25rem;
}

.footer .footer-brand:hover {
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transform: scale(1.05);
}

.footer .footer-link {
    color: var(--gray-300);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer .footer-link:hover {
    color: var(--gray-200);
}

