@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #0a0b10;
    --bg-secondary: #121420;
    --bg-card: rgba(30, 32, 50, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.3);
    --accent: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.3);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --warning: #f59e0b;
    --danger: #ef4444;
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: radial-gradient(circle at top right, #1a274c 0%, #0a0b10 70%) no-repeat;
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Background elements for abstract glows */
.bg-glow-1 {
    display: none;
}

.bg-glow-2 {
    display: none;
}

/* Auth Container */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.6s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Form inputs */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(10, 11, 16, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

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

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Navigation and Dashboard Layout */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.navbar {
    background: rgba(18, 20, 32, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-badge {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.main-content {
    flex: 1;
    padding: 40px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Dashboard views */
.dashboard-view {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.dashboard-view.active {
    display: block;
}

/* Typography & Grid elements */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.grid-dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 1024px) {
    .grid-dashboard-admin {
        grid-template-columns: 350px 1fr;
    }
}

/* Card layout */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Custom switch / checkbox stylings */
.toggle-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-input {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    position: relative;
    margin-right: 12px;
    transition: var(--transition-smooth);
    border: 1px solid var(--border-color);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    top: 2px;
    background: white;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.toggle-input:checked + .toggle-slider {
    background: var(--success);
}

.toggle-input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* Custom styled tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.custom-table th {
    background: rgba(18, 20, 32, 0.8);
    padding: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(30, 32, 50, 0.2);
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Alerts and statuses */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    gap: 6px;
}

.status-pill::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-pill.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-pill.success::before {
    background: var(--success);
}

.status-pill.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.status-pill.danger::before {
    background: var(--danger);
}

/* Selector Tabs */
.tab-container {
    display: flex;
    gap: 8px;
    background: rgba(10, 11, 16, 0.6);
    padding: 6px;
    border-radius: var(--border-radius-md);
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 18px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
    color: white;
    background: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.tab-btn[data-branch="damas"].active {
    background: #ec4899;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.4);
}

/* Roster / Planilla Form */
.roster-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.roster-row-container {
    background: rgba(18, 20, 32, 0.4);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

.roster-row-container:hover {
    border-color: rgba(59, 130, 246, 0.3);
}

.roster-row {
    display: grid;
    grid-template-columns: 40px 2.5fr 1.2fr 1.2fr 1.5fr 70px;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: none;
}

.roster-alerts {
    padding: 0 16px 12px 64px;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.alert-item {
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    animation: fadeIn 0.2s ease-out;
}

.alert-item.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-item.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.alert-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--primary);
}

.roster-num {
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    font-size: 1.1rem;
}

.checkbox-custom {
    display: flex;
    justify-content: center;
    align-items: center;
}

.checkbox-custom input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Summary / Action Bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 16px;
}

.roster-counter {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.roster-counter span {
    color: var(--success);
    font-weight: 700;
}

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

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 11, 16, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

/* Print Preview / Printed Sheet Design */
.print-sheet {
    display: none;
}

/* Print Media query rules */
@media print {
    @page {
        size: portrait;
        margin: 1cm 1.5cm;
    }
    
    body * {
        visibility: hidden;
    }
    
    #printArea, #printArea * {
        visibility: visible;
    }
    
    #printArea {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        display: block !important;
        background: white !important;
        color: black !important;
        padding: 0 !important;
        font-family: 'Arial', sans-serif;
    }
    
    body {
        background: white !important;
    }

    /* Header styling */
    .print-header-container {
        display: flex;
        align-items: center;
        margin-bottom: 20px;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
    }

    .print-logo-container {
        margin-right: 20px;
    }

    .print-title-container {
        flex: 1;
        text-align: center;
    }

    .print-assoc-title {
        font-size: 16pt;
        font-weight: bold;
        margin: 0;
        color: #000;
        letter-spacing: 0.5px;
    }

    .print-assoc-subtitle {
        font-size: 12pt;
        font-weight: bold;
        margin: 4px 0 0 0;
        color: #000;
    }

    .print-assoc-championship {
        font-size: 13pt;
        font-weight: bold;
        margin: 6px 0 0 0;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    /* Metadata grids with dot fills */
    .print-metadata-section {
        margin-bottom: 15px;
    }

    .print-metadata-row {
        display: flex;
        justify-content: space-between;
        margin-bottom: 8px;
        font-size: 10.5pt;
    }

    .print-meta-item {
        display: flex;
        flex: 1;
        align-items: flex-end;
        margin-right: 15px;
    }

    .print-meta-item:last-child {
        margin-right: 0;
    }

    .meta-label {
        font-weight: bold;
        white-space: nowrap;
        margin-right: 5px;
    }

    .meta-dots-value {
        flex: 1;
        border-bottom: 1px dotted #000;
        padding-left: 5px;
        font-weight: normal;
        text-align: left;
        line-height: 1.2;
        display: inline-block;
        min-height: 18px;
    }

    /* Watermarked Table Container */
    .print-table-wrapper {
        position: relative;
        margin-bottom: 20px;
    }

    .print-watermark {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        pointer-events: none;
        z-index: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .print-table {
        width: 100%;
        border-collapse: collapse;
        position: relative;
        z-index: 1;
        background: transparent !important;
    }

    .print-table th, .print-table td {
        border: 1px solid #000;
        padding: 5px 8px;
        font-size: 9.5pt;
        color: #000;
        background: transparent !important;
    }

    .print-table th {
        font-weight: bold;
        text-align: center;
        background-color: rgba(0, 0, 0, 0.05) !important;
        font-size: 9.5pt;
    }

    .print-table td {
        height: 28px;
        vertical-align: middle;
    }

    /* Signatures Section */
    .print-footer-signatures {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        margin-top: 45px;
        margin-bottom: 20px;
        text-align: center;
    }

    .signature-col {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .sig-title {
        font-size: 10pt;
        font-weight: bold;
        margin-bottom: 35px;
        border-top: none;
        padding-top: 0;
    }

    .sig-sello {
        font-size: 9pt;
        color: #555;
        border-top: 1px dotted #888;
        width: 80%;
        padding-top: 4px;
    }

    /* Bottom footer metadata values */
    .print-footer-meta {
        display: flex;
        justify-content: space-between;
        font-size: 10pt;
        margin-top: 15px;
    }

    .print-footer-meta .footer-meta-item {
        display: flex;
        width: 45%;
        align-items: flex-end;
    }
}
