/* Reset & Globals */
:root {
    --masc-strong: #006837;
    --masc-medium: #009c5d;
    --masc-soft: #e8f5e9;
    --masc-bg-gradient-start: #e0f2f1;
    --masc-bg-gradient-end: #f1f8e9;
    --masc-page-bg: #c8e6c9; /* Slightly darker than banner (Green 100) */

    --fem-strong: #d84315;
    --fem-medium: #f4511e;
    --fem-soft: #fbe9e7;
    --fem-bg-gradient-start: #ffebee;
    --fem-bg-gradient-end: #fff3e0;
    --fem-page-bg: #ffccbc; /* Slightly darker than banner (Deep Orange 100) */
}

body.theme-masc {
    --primary-strong: var(--masc-strong);
    --primary-medium: var(--masc-medium);
    --primary-soft: var(--masc-soft);
    --primary-gradient-start: var(--masc-bg-gradient-start);
    --primary-gradient-end: var(--masc-bg-gradient-end);
    --primary-page-bg: var(--masc-page-bg);
}

body.theme-fem {
    --primary-strong: var(--fem-strong);
    --primary-medium: var(--fem-medium);
    --primary-soft: var(--fem-soft);
    --primary-gradient-start: var(--fem-bg-gradient-start);
    --primary-gradient-end: var(--fem-bg-gradient-end);
    --primary-page-bg: var(--fem-page-bg);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: var(--primary-page-bg, #f4f4f4);
    color: #333;
    line-height: 1.6;
}

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.main-content {
    padding-bottom: 28px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Header */
header {
    background: linear-gradient(90deg, #1565c0 0%, #f4d03f 100%);
    border-bottom: none;
    padding: 20px 0;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-overlay-reopen {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    padding: 0 12px;
    min-width: 72px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.8);
    color: #111827;
    font-weight: 800;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    backdrop-filter: blur(4px);
}

.header-overlay-reopen:hover {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(255, 255, 255, 0.85);
    transform: translateY(-1px);
}

.header-overlay-reopen:focus {
    outline: 3px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    height: 70px; /* Reduced height */
    width: auto;
    object-fit: contain;
    padding-right: 15px;
    border-right: 1px solid #ccc; /* Separator line */
}

.logo-area h1 {
    font-size: 24px;
    color: #333;
    font-weight: bold;
    margin: 0;
}

.gender-switch {
    display: flex;
    background: rgba(255, 255, 255, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    padding: 4px;
    overflow: hidden;
    backdrop-filter: blur(4px);
}

.gender-option {
    padding: 10px 18px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.25s ease;
    color: rgba(255, 255, 255, 0.88);
    background: transparent;
    border-radius: 999px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.gender-option.active {
    background: #ffffff;
    color: #1f2937;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
    transform: translateY(-1px);
}

/* Navigation */
.nav-bar {
    background-color: var(--primary-strong);
    color: white;
    margin-bottom: 30px;
}

nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

nav ul li {
    position: relative;
}

nav ul li a {
    display: block;
    padding: 15px 20px;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.nav-item-arrow {
    display: inline-block;
    margin-left: 5px;
    font-size: 0.8em;
    vertical-align: middle;
}

nav ul li a:hover {
    background-color: #444;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

th, td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: var(--primary-medium);
    color: white;
    text-transform: uppercase;
    font-size: 14px;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

tr:hover {
    background-color: #f1f1f1;
}

.standings-legend {
    font-size: 0.85rem;
    color: #666;
    margin-top: -20px;
    margin-bottom: 30px;
    font-style: italic;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    padding: 24px 16px;
    box-sizing: border-box;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    margin: 5vh auto;
    padding: 30px 28px 26px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    width: min(92vw, 420px);
    border-radius: 24px;
    position: relative;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: #eef2f7;
    color: #7c8798;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.close-modal:hover {
    background: #dbe4ef;
    color: #102a43;
    transform: scale(1.04);
}

.modal-logo-area {
    text-align: center;
    margin-bottom: 16px;
}

.sistema-logo {
    font-family: 'Arial Black', sans-serif;
    font-size: 1.35rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.modal-eyebrow {
    display: inline-block;
    margin: 0 auto 12px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(15, 76, 129, 0.10);
    color: #0f4c81;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.modal-title {
    text-align: center;
    color: #0f172a;
    font-weight: 800;
    margin: 0 0 10px;
    font-size: 1.8rem;
    line-height: 1.15;
    text-transform: none;
    letter-spacing: -0.02em;
}

.modal-subtitle {
    text-align: center;
    margin: 0 0 20px;
    font-weight: 500;
    color: #4a5568;
    line-height: 1.65;
}

.modal-subtitle strong {
    color: #0f172a;
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-input {
    padding: 14px 16px;
    border: 1px solid #d4dce8;
    border-radius: 14px;
    width: 100%;
    box-sizing: border-box;
    background: #f8fafc;
    color: #1e293b;
    font-size: 0.98rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.modal-input:focus {
    border-color: #0f4c81;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(15, 76, 129, 0.14);
}

.modal-input::placeholder {
    color: #94a3b8;
}

.password-field {
    position: relative;
}

.password-field .modal-input {
    padding-right: 52px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #7c8aa0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.password-toggle:hover {
    background: rgba(15, 76, 129, 0.08);
    color: #0f4c81;
}

.password-toggle:focus {
    outline: none;
    background: rgba(15, 76, 129, 0.10);
    color: #0f4c81;
}

.modal-btn {
    background: linear-gradient(135deg, #0f4c81 0%, #0a2f57 100%);
    color: #ffffff;
    border: none;
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 800;
    width: 100%;
    border-radius: 14px;
    align-self: stretch;
    box-shadow: 0 16px 30px rgba(15, 76, 129, 0.26);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.modal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 36px rgba(15, 76, 129, 0.32);
    filter: brightness(1.03);
}

.modal-feedback {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    border-radius: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
    font-size: 0.94rem;
}

.modal-feedback.error {
    background: #fff5f5;
    border: 1px solid #fecaca;
    color: #c53030;
}

.modal-feedback.success {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #2f855a;
}

.modal-link-row {
    margin-top: 16px;
    text-align: center;
}

.modal-link {
    color: #0f4c81;
    text-decoration: none;
    font-weight: 800;
    transition: color 0.2s ease;
}

.modal-link:hover {
    color: #0a2f57;
}

.auth-modal .modal-content {
    width: min(92vw, 470px);
}

.auth-highlight {
    color: #0f172a;
    font-weight: 800;
}

.role-selection-modal {
    z-index: 2000;
}

.role-selection-modal .modal-content {
    width: min(94vw, 540px);
}

.role-selection-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.role-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 16px 18px;
    background: linear-gradient(180deg, #f8fbff 0%, #f1f5f9 100%);
    color: #1e293b;
    border: 1px solid #d7e1ee;
    border-radius: 18px;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.role-btn:hover {
    border-color: #b8cbe2;
    background: linear-gradient(180deg, #ffffff 0%, #eef6ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.10);
}

.role-btn:focus {
    outline: none;
    border-color: #0f4c81;
    box-shadow: 0 0 0 4px rgba(15, 76, 129, 0.12);
}

.role-icon-badge {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    font-size: 1.35rem;
}

.role-icon-badge.admin {
    color: #2c7a7b;
    background: rgba(44, 122, 123, 0.12);
}

.role-icon-badge.delegate {
    color: #c05621;
    background: rgba(192, 86, 33, 0.12);
}

.role-icon-badge.responsible {
    color: #2b6cb0;
    background: rgba(43, 108, 176, 0.12);
}

.role-icon-badge.director {
    color: #6b46c1;
    background: rgba(107, 70, 193, 0.12);
}

.role-icon {
    font-size: 1.3rem;
}

.role-copy {
    flex: 1;
    min-width: 0;
}

.role-name {
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.25;
    color: #1e293b;
}

.role-desc {
    margin-top: 2px;
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.35;
}

.role-btn-arrow {
    margin-left: 14px;
    color: #c0cad8;
    font-size: 1rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

.role-btn:hover .role-btn-arrow {
    color: #0f4c81;
    transform: translateX(2px);
}


/* Dropdown */
.dropdown-container {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 250px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1;
    top: 100%;
    left: 0;
    border-top: 3px solid var(--primary-medium);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

/* Titles */
.section-title {
    border-left: 5px solid var(--primary-medium);
    padding-left: 10px;
    color: var(--primary-strong);
    margin-top: 30px;
    margin-bottom: 20px;
}

.stats-title {
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 0;
    color: var(--primary-strong);
}

.stats-value {
    font-weight: bold;
    font-size: 1.2em;
    color: var(--primary-strong);
}

.dropdown-header {
    background-color: #f9f9f9;
    padding: 0;
    font-weight: bold;
}

.dropdown-header a {
    font-weight: bold;
    color: var(--primary-medium);
}

.dropdown-divider {
    height: 1px;
    background-color: #ddd;
    margin: 5px 0;
}

/* Banner de Destaque */
.highlight-banner {
    border-radius: 20px;
    padding: 14px 40px 12px;
    margin-bottom: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    border: none;
    position: relative;
    overflow: hidden;
    background: linear-gradient(to right, var(--primary-gradient-start), var(--primary-gradient-end));
}

/* Gradient Backgrounds */
/* Legacy classes removed or kept for reference if needed elsewhere */
.banner-masc, .banner-fem {
    /* No longer needed for background, but kept for specificity if any */
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
    margin-bottom: 8px;
}

.banner-logo-section {
    flex-shrink: 0;
}

.banner-logo-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.banner-icon {
    font-size: 4rem;
}

.banner-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-main {
    font-family: 'Arial Black', sans-serif;
    font-size: 2rem;
    color: #333;
    letter-spacing: -1px;
}

.logo-sub {
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.theme-masc .logo-sub { color: var(--masc-strong); }
.theme-fem .logo-sub { color: var(--fem-strong); }


.banner-text-section {
    flex-grow: 1;
}

.banner-subtitle {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.75rem;
    color: #555;
    margin: 0 0 5px 0;
    font-weight: bold;
}

.highlight-banner h2 {
    color: #1a1a1a;
    margin: 0;
    font-weight: 800;
    font-size: 1.625rem;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
}

.banner-title-main,
.banner-title-gender {
    font-size: inherit;
    font-weight: 800;
}

.banner-title-gender {
    color: #2d3748;
}

.banner-desc {
    color: #444;
    font-size: 1rem;
    margin-bottom: 0;
    max-width: 600px;
    line-height: 1.25;
}

.banner-tags {
    display: flex;
    gap: 10px;
}

.banner-tag {
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.theme-masc .banner-tag {
    background-color: #a5d6a7;
    color: #1b5e20;
}
.theme-masc .tag-season {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.theme-fem .banner-tag {
    background-color: #ffab91;
    color: #bf360c;
}
.theme-fem .tag-season {
    background-color: #fbe9e7;
    color: #d84315;
    border: 1px solid #ffab91;
}


.category-title {
    margin: 8px 0 4px;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 1.8px;
    color: #000000;
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 12px;
}

.category-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    color: #555;
    transition: all 0.3s;
    background: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    line-height: 1.1;
    text-align: center;
}

.category-btn-name {
    font-weight: 700;
    text-align: center;
}

.category-btn-status {
    font-size: 0.72rem;
    font-weight: 700;
    color: #4a5568;
    text-align: center;
}

.category-btn-status.status-planned {
    color: #4a5568;
}

.category-btn-status.status-ongoing {
    color: #b7791f;
}

.category-btn-status.status-finished {
    color: #2f855a;
}

.category-btn.active {
    background-color: var(--primary-strong);
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.category-btn.active .category-btn-status {
    color: rgba(255,255,255,0.9);
}
.theme-masc .category-btn.active {
    background-color: var(--masc-strong);
}
.theme-fem .category-btn.active {
    background-color: var(--fem-strong);
}

.category-btn:hover:not(.active) {
    background-color: rgba(255,255,255,0.9);
}

/* Competition Menu Strip */
.competition-nav {
    border-radius: 32px;
    margin-bottom: 30px;
    padding: 2px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.10);
    background: rgba(255, 255, 255, 0.90);
    border: 1px solid rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(6px);
}

.nav-masc, .nav-fem {
    /* Legacy - background handled by competition-nav via variables */
}

.nav-container {
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 0;
}

.nav-item {
    flex: 1;
    padding: 16px 30px;
    color: #374151;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.28em;
    text-align: center;
    border-radius: 0;
    transition: all 0.25s ease;
}

.nav-item:first-child {
    border-radius: 30px 0 0 30px;
}

.nav-item:last-child {
    border-radius: 0 30px 30px 0;
}

.nav-item:hover {
    background-color: rgba(255,255,255,0.6);
    color: #111827;
}

.nav-item.active {
    background: linear-gradient(90deg, var(--primary-strong) 0%, var(--primary-medium) 45%, var(--primary-gradient-end) 100%);
    color: #111827;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* Specific active colors per gender */
.nav-masc .nav-item.active,
.nav-fem .nav-item.active,
.nav-item.active {
    color: #111827;
}

.mobile-table-frame {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    transition: height 0.2s ease;
}

.mobile-table-scale-wrap {
    width: max-content;
    min-width: 100%;
    transform-origin: top left;
    transition: transform 0.2s ease;
}

.mobile-table-frame .custom-table {
    display: table;
    width: max-content;
    min-width: 100%;
}

/* Adjustments for mobile */
@media (max-width: 768px) {
    .container {
        width: 100%;
        padding: 0 12px;
    }

    header {
        padding: 14px 0;
        position: relative;
    }

    header .container {
        position: relative;
    }

    .header-logo {
        height: 54px;
        padding-right: 0;
        border-right: 0;
    }

    .logo-area {
        gap: 10px;
    }

    .logo-area h1 {
        font-size: 22px;
        line-height: 1.2;
    }

    .banner-content {
        flex-direction: column;
        text-align: center;
        gap: 6px;
        margin-bottom: 4px;
    }
    .highlight-banner {
        padding: 8px 20px 6px;
        border-radius: 16px;
    }
    .highlight-banner h2 {
        font-size: 1.15rem;
    }
    .banner-icon {
        font-size: 3rem;
    }
    .banner-tags {
        justify-content: center;
    }
    .category-tabs {
        justify-content: center;
    }
    .category-title {
        margin: 6px 0 4px;
        font-size: 1rem;
        letter-spacing: 1.4px;
    }
    .header-top {
        flex-direction: column;
        gap: 10px;
        padding-top: 24px;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .gender-switch {
        order: 1;
        width: min(520px, 100%);
    }

    .header-overlay-reopen {
        position: absolute;
        top: 0;
        right: 12px;
        height: 20px;
        padding: 0 10px;
        min-width: 64px;
        font-size: 10px;
        font-weight: 800;
        order: 2;
        z-index: 3;
    }

    .gender-option {
        flex: 1;
        padding: 8px 0;
    }

    nav ul {
        flex-direction: column;
    }
    nav ul li a {
        padding: 10px;
        border-bottom: 1px solid #444;
    }
    .nav-container {
        flex-direction: row;
        text-align: center;
        gap: 0;
    }
    .competition-nav {
        border-radius: 24px;
        padding: 2px;
    }
    .nav-item {
        width: 50%;
        padding: 14px 10px;
        font-size: 0.72rem;
        letter-spacing: 0.18em;
    }
    .nav-item:first-child {
        border-radius: 22px 0 0 22px;
    }
    .nav-item:last-child {
        border-radius: 0 22px 22px 0;
    }

    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-table-frame {
        overflow: hidden;
    }

    .mobile-table-frame table,
    .mobile-table-frame .custom-table {
        display: table;
        overflow: visible;
        -webkit-overflow-scrolling: auto;
    }

    th, td {
        white-space: nowrap;
    }

    .mobile-table-frame .custom-table {
        display: table;
    }

    .modal-content {
        width: min(92vw, 520px);
        margin: 7vh auto;
        max-height: 80vh;
        overflow: auto;
        padding: 24px 20px 22px;
        border-radius: 20px;
    }

    .modal-title {
        font-size: 1.45rem;
    }

    .modal-subtitle {
        font-size: 0.98rem;
    }

    .role-btn {
        padding: 14px 15px;
        border-radius: 16px;
    }

    .role-icon-badge {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        margin-right: 12px;
    }

    .role-name {
        font-size: 1rem;
    }

    .role-desc {
        font-size: 0.84rem;
    }
}
