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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #1f2937;
    line-height: 1.6;
    background: #f9fafb;
}

/* Header */
header {
    color: white;
    padding: 0.75rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 3px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

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

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* Mobile Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    padding: 0 0 2rem 0;
}

.mobile-sidebar.active {
    right: 0;
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-sidebar .menu-section {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.mobile-sidebar .menu-section:last-child {
    border-bottom: none;
}

.mobile-sidebar a {
    display: block;
    padding: 1rem 1.5rem;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
}

.mobile-sidebar a:hover {
    background: #f3f4f6;
}

.mobile-sidebar .section-title {
    padding: 1rem 1.5rem 0.5rem 1.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mobile-sidebar .btn {
    margin: 1rem 1.5rem;
    width: calc(100% - 3rem);
    text-align: center;
}

.mobile-sidebar .logout-link {
    color: #dc2626 !important;
}

/* Dropdown menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 8px;
    z-index: 1000;
    top: 100%;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-content::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: 0;
    right: 0;
    height: 0.5rem;
    background: transparent;
}

.dropdown-content a {
    color: #374151;
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    font-weight: 500;
    transition: background-color 0.15s;
}

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

.dropdown-content a:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-content a:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown:hover .dropdown-content,
.dropdown .dropdown-content:hover {
    display: block;
}

.dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.dropdown:hover .dropdown-toggle {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

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

.stat-value {
    font-size: 3rem;
    font-weight: bold;
}

.stat-label {
    color: #6b7280;
    margin-top: 0.5rem;
}

/* Match vs separator */
.match-vs {
    font-size: 2rem;
    font-weight: bold;
    color: #9ca3af;
}

/* Prediction Score Layout */
.prediction-score-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.team-score-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.team-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.team-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.score-input {
    width: 60px;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    -moz-appearance: textfield;
}

.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Filters Toggle Button */
.filters-toggle-btn {
    display: none;
}

.filters-container {
    display: block;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.filters-result-row {
    display: flex;
    gap: 1rem;
    align-items: end;
}

.filters-result-row .form-group {
    flex: 1;
    max-width: calc(33.333% - 0.5rem);
}

/* Match Detail Header - Desktop */
.match-detail-title {
    font-size: 2rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.match-detail-home,
.match-detail-away {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.match-detail-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.match-detail-score-desktop {
    font-weight: bold;
}

.match-detail-separator {
    color: #9ca3af;
}

.match-detail-score-mobile {
    display: none;
}

/* Match Card Layout */
.match-info {
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.team-home,
.team-away {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 180px;
    font-size: 1.2rem;
}

.team-home {
    justify-content: flex-end;
}

.team-away {
    justify-content: flex-start;
}

.match-score {
    background: #f3f4f6;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
    font-size: 1.2rem;
}

.match-status {
    background: #fef3c7;
    color: #d97706;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.9rem;
}

.team-score-mobile {
    display: none;
}

.match-status-mobile {
    display: none;
}

.match-status-desktop {
    display: block;
}

/* ============================================
   BUTTONS - Sistema padronizado de botões
   ============================================ */

/* Base Button - Classe base para todos os botões */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    white-space: nowrap;
    justify-content: center;
}

/* Primary Button - Ação principal (usa cores do tenant) */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    white-space: nowrap;
    justify-content: center;
    background: var(--tenant-primary-color, #667eea);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

/* Secondary Button - Ação secundária */
.btn-secondary,
.secondary-button {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover,
.secondary-button:hover {
    background: #d1d5db;
    transform: translateY(-1px);
}

/* Tertiary Button - Ação menos importante */
.btn-tertiary,
.tertiary-button {
    background: transparent;
    color: #6b7280;
    border: 2px solid #e5e7eb;
    padding: 0.625rem 1.25rem;
}

.btn-tertiary:hover,
.tertiary-button:hover {
    border-color: var(--tenant-primary-color, #667eea);
    color: var(--tenant-primary-color, #667eea);
    background: rgba(102, 126, 234, 0.05);
}

/* Success Button - Ação positiva/confirmação */
.btn-success,
.success-button {
    background: #10b981;
    color: white;
}

.btn-success:hover,
.success-button:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Danger Button - Ação destrutiva */
.btn-danger,
.danger-button {
    background: #ef4444;
    color: white;
}

.btn-danger:hover,
.danger-button:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Warning Button - Ação de alerta */
.btn-warning,
.warning-button {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover,
.warning-button:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Info Button - Informação */
.btn-info,
.info-button {
    background: #3b82f6;
    color: white;
}

.btn-info:hover,
.info-button:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Button Sizes */
.btn-small,
.btn-sm {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.btn-large,
.btn-lg {
    font-size: 1.125rem;
    padding: 1rem 2rem;
}

/* Button Width Modifiers */
.btn-full-width,
.btn-block {
    width: 100%;
    display: flex;
}

/* Disabled State */
.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Button with icon */
.btn-icon-left {
    flex-direction: row;
}

.btn-icon-right {
    flex-direction: row-reverse;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .btn-mobile-full {
        width: 100%;
        display: flex;
    }
}

/* ============================================
   PAGE HEADER - Padrão unificado de cabeçalhos
   ============================================ */
.page-header {
    margin-bottom: 2rem;
}

.page-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.page-header-left {
    flex: 1;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: #1f2937;
    line-height: 1.2;
}

.page-header-subtitle {
    color: #6b7280;
    font-size: 1.125rem;
    margin-bottom: 0;
    line-height: 1.5;
}

/* Responsivo para page header */
@media (max-width: 768px) {
    .page-header {
        margin-bottom: 1.5rem;
    }

    .page-header h1 {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }

    .page-header-subtitle {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .page-header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        margin-bottom: 1rem;
    }
}

/* Back Button */
.back-button-container {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #f3f4f6;
    color: #374151;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.back-button:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

/* Messages */
.messages {
    margin-bottom: 2rem;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* Footer */
footer {
    background: #1f2937;
    color: white;
    padding: 2rem;
    margin-top: 4rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        padding: 0 1rem;
    }
    
    .hamburger {
        display: flex;
    }
    
    .nav-links {
        display: none;
    }
    
    main {
        padding: 0 1rem;
        margin: 1.5rem auto;
    }
    
    /* Match Detail Header - Mobile */
    .match-detail-title {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 1.5rem;
    }
    
    .match-detail-home,
    .match-detail-away {
        width: 100%;
        justify-content: flex-start;
        gap: 0.75rem;
        background: #f9fafb;
        padding: 0.75rem;
        border-radius: 8px;
    }
    
    .match-detail-logo {
        width: 48px !important;
        height: 48px !important;
        order: 1;
    }
    
    .match-detail-team-name {
        flex: 1;
        text-align: left;
        order: 2;
        font-size: 1.1rem;
    }
    
    .match-detail-score-mobile {
        display: block;
        order: 3;
        font-size: 1.5rem;
        font-weight: bold;
    }
    
    .match-detail-score-desktop,
    .match-detail-separator {
        display: none;
    }
    
    /* Compact cards for mobile */
    .card {
        padding: 1.25rem;
        margin-bottom: 1rem;
        border-radius: 8px;
    }
    
    .stats-grid {
        gap: 1rem;
        margin-bottom: 0.75rem;
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 2.5rem;
    }
    
    .stat-label {
        margin-top: 0.25rem;
        font-size: 0.9rem;
    }
    
    /* Hide match vs separator on mobile */
    .match-vs {
        display: none;
    }
    
    /* Prediction score layout for mobile */
    .prediction-score-container {
        gap: 1.5rem;
        flex-direction: column;
    }
    
    .team-score-group {
        width: 100%;
        justify-content: flex-start;
        gap: 0.75rem;
        flex-direction: row;
    }
    
    .team-logo {
        width: 48px;
        height: 48px;
        order: 1;
    }
    
    .team-name {
        font-size: 1rem;
        flex: 1;
        text-align: left;
        order: 2;
    }
    
    .score-input {
        width: 70px;
        padding: 0.6rem;
        font-size: 1.75rem;
        order: 3;
    }
    
    /* Filters Toggle for Mobile */
    .filters-toggle-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        background: #f3f4f6;
        padding: 0.5rem 1rem;
        border-radius: 8px;
        border: none;
        color: #374151;
        font-weight: 500;
        cursor: pointer;
        font-size: 1rem;
    }
    
    .filters-toggle-btn.active {
        background: white;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        color: #1f2937;
    }
    
    .filters-container {
        display: none;
        margin-top: 1rem;
    }
    
    .filters-container.show {
        display: block;
    }
    
    /* Match filters - one per line on mobile */
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .filters-result-row {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .filters-result-row .form-group {
        max-width: 100%;
    }
    
    /* Match Card Mobile Layout */
    .match-info {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }
    
    .match-teams {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .team-home,
    .team-away {
        min-width: auto;
        justify-content: space-between;
        padding: 0.5rem 0.75rem;
        background: #f9fafb;
        border-radius: 6px;
    }
    
    .team-home img,
    .team-away img {
        width: 36px !important;
        height: 36px !important;
    }
    
    .team-home img {
        order: 1;
    }
    
    .team-away img {
        order: 1;
    }
    
    .team-home strong:not(.team-score-mobile),
    .team-away strong:not(.team-score-mobile) {
        order: 2;
        flex: 1;
    }
    
    .team-score-mobile {
        order: 3;
    }
    
    .match-score,
    .match-status {
        align-self: center;
        margin: 0.25rem 0;
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }
    
    /* Hide desktop score, show mobile score */
    .match-score {
        display: none;
    }
    
    .team-score-mobile {
        display: block;
        font-size: 1.25rem;
        color: #374151;
    }
    
    /* Hide desktop status, show mobile status after teams */
    .match-status-desktop {
        display: none;
    }
    
    .match-status-mobile {
        display: block;
        align-self: center;
        margin: 0.25rem 0;
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }
}
