/* System Projektowy i Style Portalu UKS Czułowianka Tychy */

:root {
    --primary-font: 'Inter', sans-serif;
    --heading-font: 'Outfit', sans-serif;

    /* Kolory marki */
    --emerald-50: #f0fdf4;
    --emerald-100: #dcfce7;
    --emerald-500: #16a34a;
    --emerald-600: #15803d;
    --emerald-700: #166534;
    
    --sky-500: #0284c7;
    --sky-600: #0369a1;
    
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    
    /* Kolory systemowe */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #020617;
    
    --white: #ffffff;
    
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    
    /* Cienie i zaokrąglenia */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

body {
    font-family: var(--primary-font);
    background-color: var(--slate-100);
    color: var(--slate-800);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    color: var(--slate-900);
    font-weight: 700;
}

/* Klasy pomocnicze */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

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

.flex-gap-2 {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

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

.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

.mx-auto { margin-left: auto; margin-right: auto; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-lg { font-size: 1.125rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.font-mono { font-family: monospace; }
.italic { font-style: italic; }
.uppercase { text-transform: uppercase; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Baner Informacji o Cookies */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: var(--slate-900);
    border-top: 2px solid var(--emerald-600);
    box-shadow: var(--shadow-xl);
    padding: 1rem 1.5rem;
}

.cookie-banner-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cookie-banner-content p {
    flex: 1 1 320px;
    margin: 0;
    font-size: 0.9rem;
    color: var(--slate-300);
    line-height: 1.5;
}

.cookie-banner-btn {
    flex: 0 0 auto;
    background: var(--emerald-600);
    color: var(--white);
    border: none;
    padding: 0.7rem 1.6rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-family: var(--primary-font);
    cursor: pointer;
    transition: background 0.2s ease;
}

.cookie-banner-btn:hover {
    background: var(--emerald-700);
}

.text-emerald { color: var(--emerald-600) !important; }
.text-sky { color: var(--sky-500) !important; }
.text-amber { color: var(--amber-400) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--slate-500) !important; }

.bg-slate { background-color: var(--slate-50); }
.bg-white { background-color: var(--white); }

/* Pasek Nawigacyjny */
.app-header {
    background-color: var(--slate-900);
    border-bottom: 2px solid var(--emerald-700);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

/* Herb Klubowy */
.portal-logo {
    height: 52px;
    width: auto;
    filter: drop-shadow(0 2px 6px rgba(16, 185, 129, 0.3));
    transition: transform 0.2s ease;
}

.portal-logo:hover {
    transform: scale(1.05);
}

.brand-text h1 {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.2;
}

.brand-text p {
    font-size: 10px;
    color: var(--emerald-100);
    font-weight: 600;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#auth-status-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

#user-display-email {
    color: var(--slate-300);
    font-weight: 500;
}

@media (max-width: 767px) {
    .header-container {
        flex-wrap: wrap;
        row-gap: 0.5rem;
    }

    .nav-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
        width: 100%;
    }

    #auth-status-bar {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.35rem;
    }
}

/* Stopka */
.app-footer {
    background-color: var(--slate-900);
    border-t: 1px solid var(--slate-800);
    color: var(--slate-400);
    font-size: 0.75rem;
    padding: 2rem 0;
    margin-top: auto;
}

/* Layout główny */
.app-main {
    flex: 1;
    padding: 2rem 0;
}

/* Układ Siatki */
.grid {
    display: grid;
    gap: 1.5rem;
}

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

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

/* Przyciski */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-align: center;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-primary {
    background-color: var(--emerald-600);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--emerald-700);
}

.btn-success {
    background-color: var(--emerald-500);
    color: var(--white);
}

.btn-success:hover {
    background-color: var(--emerald-600);
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-amber {
    background-color: var(--amber-500);
    color: var(--white);
}

.btn-amber:hover {
    background-color: #d97706;
}

.btn-outline {
    background-color: transparent;
    border-color: var(--slate-300);
    color: var(--slate-700);
}

.btn-outline:hover {
    background-color: var(--slate-100);
    border-color: var(--slate-400);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Odznaka (Badge) */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-emerald {
    background-color: var(--emerald-100);
    color: var(--emerald-700);
}

.badge-sky {
    background-color: #e0f2fe;
    color: var(--sky-600);
}

.badge-amber {
    background-color: #fef3c7;
    color: var(--amber-500);
}

.badge-danger {
    background-color: var(--danger-light);
    color: var(--danger);
}

/* Karty (Cards) */
.card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-dark {
    background-color: var(--slate-900);
    color: var(--white);
    border: none;
}

.card-dark h3 {
    color: var(--white);
}

.card-header {
    padding: 1rem 1.5rem;
    border-b: 1px solid var(--slate-200);
    font-size: 1rem;
}

.card-dark .card-header {
    border-b: 1px solid var(--slate-800);
}

.card-body {
    padding: 1.5rem;
}

/* Statystyczne Karty w Panelu Admina */
.stat-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--slate-200);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.bg-emerald-light { background-color: var(--emerald-50); }
.bg-success-light { background-color: var(--success-light); }
.bg-warning-light { background-color: var(--warning-light); }
.bg-danger-light { background-color: var(--danger-light); }

.stat-data {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--slate-400);
    text-transform: uppercase;
}

.stat-val {
    font-size: 1.25rem;
    font-weight: 800;
    margin-top: 0.125rem;
}

/* Formularze i Kontrolki */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-group label {
    font-size: 11px;
    font-weight: 700;
    color: var(--slate-600);
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-md);
    background-color: var(--white);
    color: var(--slate-800);
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--emerald-500);
    box-shadow: 0 0 0 3px var(--emerald-100);
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-wrapper i {
    position: absolute;
    left: 1rem;
    color: var(--slate-400);
    font-size: 0.875rem;
}

.input-icon-wrapper input {
    padding-left: 2.5rem !important;
}

/* Tabele */
.table-responsive {
    overflow-x: auto;
    background-color: var(--white);
}

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

.table th {
    background-color: var(--slate-50);
    font-weight: 700;
    color: var(--slate-700);
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--slate-200);
    text-transform: uppercase;
    font-size: 10px;
}

.table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--slate-150);
    color: var(--slate-600);
    vertical-align: middle;
}

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

.table-hover tbody tr:hover {
    background-color: var(--slate-50);
}

/* Karty Autoryzacji */
.auth-card {
    background-color: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
}

.auth-tabs {
    display: flex;
    background-color: var(--slate-50);
    border-bottom: 1px solid var(--slate-200);
}

.auth-tab-btn {
    flex: 1;
    padding: 1.25rem;
    font-weight: 700;
    font-size: 0.875rem;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--slate-500);
    font-family: var(--heading-font);
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.auth-tab-btn.active {
    color: var(--emerald-600);
    border-bottom-color: var(--emerald-600);
    background-color: var(--white);
}

.auth-body {
    padding: 2rem;
}

.btn-link-forgot {
    display: block;
    width: 100%;
    text-align: center;
    background: none;
    border: none;
    color: var(--emerald-600);
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.75rem;
    cursor: pointer;
    padding: 0.25rem;
}

.btn-link-forgot:hover {
    text-decoration: underline;
}

.demo-notice {
    background-color: var(--emerald-50);
    border: 1px solid var(--emerald-100);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-size: 0.75rem;
    color: var(--emerald-700);
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.demo-notice i {
    font-size: 1.125rem;
    margin-top: 0.125rem;
}

.selectable {
    user-select: all;
    background-color: var(--emerald-100);
    padding: 0.05rem 0.25rem;
    border-radius: 4px;
}

/* Zakładki Admina */
.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    background-color: var(--slate-50);
    border-bottom: 1px solid var(--slate-200);
    padding: 0.5rem 1rem 0 1rem;
    gap: 0.25rem;
}

.admin-tab-btn {
    padding: 0.75rem 1.25rem;
    font-weight: 700;
    font-size: 0.8125rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background: none;
    cursor: pointer;
    color: var(--slate-500);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-tab-btn:hover {
    color: var(--slate-800);
    background-color: var(--slate-100);
}

.admin-tab-btn.active {
    color: var(--emerald-600);
    background-color: var(--white);
    border-color: var(--slate-200) var(--slate-200) transparent var(--slate-200);
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.02);
}

.admin-tab-content {
    padding: 1rem 0;
}

.search-bar {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%;
    max-width: 320px;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    color: var(--slate-400);
}

.search-bar input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--emerald-500);
}

/* Ustawienia Importu Przelewów */
.dropzone {
    border: 2px dashed var(--slate-300);
    border-radius: var(--radius-lg);
    background-color: var(--slate-50);
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropzone:hover {
    border-color: var(--emerald-500);
    background-color: var(--emerald-50);
}

.dropzone-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Okna Modalne */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.modal-content {
    background-color: var(--white);
    border-radius: var(--radius-xl);
    width: 100%;
    max-height: 90vh;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--slate-900);
    color: var(--white);
}

.modal-header h3 {
    color: var(--white);
    font-size: 1.125rem;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--slate-400);
    cursor: pointer;
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--white);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.modal-content > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--slate-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background-color: var(--slate-50);
}

.max-w-xs { max-width: 320px; }
.max-w-sm { max-width: 420px; }
.max-w-md { max-width: 520px; }
.max-w-lg { max-width: 640px; }
.max-w-2xl { max-width: 672px; }
.max-w-6xl { max-width: 920px; }

/* Karta Szczegółowa Zawodnika */
#modal-child-details .modal-body {
    padding: 2rem 6rem !important;
}

#modal-child-details .modal-footer {
    padding: 1.5rem 6rem !important;
}

#modal-child-details .grid {
    margin-top: 1rem;
    margin-left: 1rem;
    margin-right: 1rem;
}

#modal-child-details .card {
    padding: 0.5rem !important;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

/* Powiadomienia Toast */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    background-color: var(--slate-900);
    color: var(--white);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.8125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-danger {
    border-left: 4px solid var(--danger);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Awatar */
.avatar-large {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    background-color: var(--emerald-50);
    border: 2px solid var(--emerald-100);
    color: var(--emerald-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
}

/* Informacje pomocnicze w formularzu naliczania */
.icon-circle {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-emerald {
    background-color: var(--emerald-500);
}

.list-bullet {
    list-style-type: disc;
    padding-left: 1.25rem;
}

/* ======================================================== */
/* MEDIA PRINT (WYDRUK DOKUMENTÓW)                          */
/* ======================================================== --> */
@media print {
    @page {
        size: A4 portrait;
        margin: 15mm;
    }
    
    body {
        background-color: var(--white) !important;
        color: #000000 !important;
    }

    /* Ukryj wszystkie standardowe elementy strony */
    body > header,
    body > main,
    body > footer,
    .modal-backdrop,
    #toast-container {
        display: none !important;
    }

    /* Wyświetl tylko wybrane okno druku */
    .print-page {
        display: block !important;
        position: static !important;
        width: 100% !important;
        height: auto !important;
        background-color: var(--white) !important;
        color: #000000 !important;
        font-family: 'Georgia', serif !important;
    }
    
    .print-page.hidden {
        display: none !important;
    }

    .club-badge-print {
        border: 2px solid #000000 !important;
    }

    /* Ukrycie obramowań innych niż czarno-białe */
    .border {
        border-color: #000000 !important;
    }

    .text-muted-print {
        color: #555555 !important;
        font-size: 8px !important;
        font-style: italic !important;
        display: block;
    }
}
