/* ============================================================================
   PDF CARD & LAYOUT - Optimiert fuer DIN A4 Portrait-PDFs
   iframe regelt seine Hoehe selbst via calc(100vh - 280px).
   Card ist nur ein visueller Container ohne eigene Hoehensteuerung.
   Getestet: Chrome 120+, Edge 120+, Firefox 121+
   ============================================================================ */

.pdf-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================================
   BUTTONS - Ciblu Branded
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--ciblu-primary);
    border-color: var(--ciblu-primary);
    color: white;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--ciblu-primary-700);
    border-color: var(--ciblu-primary-700);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:active, .btn-primary.active {
    background-color: var(--ciblu-primary-800);
    border-color: var(--ciblu-primary-800);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

.btn-secondary {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--surface-alt);
    border-color: var(--gray-300);
    color: var(--text-primary);
}

.btn-outline-primary {
    background-color: transparent;
    border-color: var(--ciblu-primary-text);
    color: var(--ciblu-primary-text);
}

.btn-outline-primary:hover {
    background-color: var(--ciblu-primary);
    color: white;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--ciblu-primary-text);
    padding: 0.5rem 1rem;
}

.btn-text:hover {
    color: var(--ciblu-primary-text-hover);
    text-decoration: underline;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

/* ============================================================================
   CARDS & SURFACES
   ============================================================================ */

.card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ============================================================================
   SEARCH INPUT
   ============================================================================ */

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input-wrapper .search-input {
    padding-left: 2.75rem;
}

.results-count {
    font-size: 0.875rem;
}

/* ============================================================================
   FORMS
   ============================================================================ */

.form-control {
    width: 100%;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    background-color: var(--surface);
    border-color: var(--ciblu-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.15);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-secondary);
}

.form-select {
    width: 100%;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    padding: 0.75rem 2.25rem 0.75rem 1rem;
    font-size: 0.9375rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-select:focus {
    background-color: var(--surface);
    border-color: var(--ciblu-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.15);
    outline: none;
}

/* Dark mode form control overrides - explicit high-specificity selectors
   to defeat Bootstrap 5.3 hardcoded light colors (WCAG AA 4.5:1 contrast) */
body.theme-dark .form-control,
body.theme-dark .form-select {
    background-color: var(--surface-dark);
    border-color: var(--border-dark);
    color: var(--text-primary-dark);
    color-scheme: dark;
}

body.theme-dark .form-control:focus,
body.theme-dark .form-select:focus {
    background-color: var(--surface-dark);
    border-color: var(--ciblu-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.15);
    color: var(--text-primary-dark);
}

body.theme-dark .form-control::placeholder {
    color: var(--text-secondary-dark);
}

body.theme-dark .form-control:-webkit-autofill,
body.theme-dark .form-control:-webkit-autofill:hover,
body.theme-dark .form-control:-webkit-autofill:focus,
body.theme-dark .form-select:-webkit-autofill {
    -webkit-text-fill-color: var(--text-primary-dark);
    -webkit-box-shadow: 0 0 0px 1000px var(--surface-dark) inset;
    border-color: var(--border-dark);
    transition: background-color 5000s ease-in-out 0s;
}

body.theme-dark .form-control:disabled,
body.theme-dark .form-control[readonly],
body.theme-dark .form-select:disabled {
    background-color: var(--surface-alt-dark);
    color: var(--text-secondary-dark);
    opacity: 0.65;
}

/* OS dark preference: same overrides for System mode with dark OS preference */
@media (prefers-color-scheme: dark) {
    body:not(.theme-light):not(.theme-dark) .form-control,
    body:not(.theme-light):not(.theme-dark) .form-select {
        background-color: var(--surface-dark);
        border-color: var(--border-dark);
        color: var(--text-primary-dark);
        color-scheme: dark;
    }

    body:not(.theme-light):not(.theme-dark) .form-control:focus,
    body:not(.theme-light):not(.theme-dark) .form-select:focus {
        background-color: var(--surface-dark);
        border-color: var(--ciblu-primary);
        box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.15);
        color: var(--text-primary-dark);
    }

    body:not(.theme-light):not(.theme-dark) .form-control::placeholder {
        color: var(--text-secondary-dark);
    }

    body:not(.theme-light):not(.theme-dark) .form-control:-webkit-autofill,
    body:not(.theme-light):not(.theme-dark) .form-control:-webkit-autofill:hover,
    body:not(.theme-light):not(.theme-dark) .form-control:-webkit-autofill:focus,
    body:not(.theme-light):not(.theme-dark) .form-select:-webkit-autofill {
        -webkit-text-fill-color: var(--text-primary-dark);
        -webkit-box-shadow: 0 0 0px 1000px var(--surface-dark) inset;
        border-color: var(--border-dark);
        transition: background-color 5000s ease-in-out 0s;
    }

    body:not(.theme-light):not(.theme-dark) .form-control:disabled,
    body:not(.theme-light):not(.theme-dark) .form-control[readonly],
    body:not(.theme-light):not(.theme-dark) .form-select:disabled {
        background-color: var(--surface-alt-dark);
        color: var(--text-secondary-dark);
        opacity: 0.65;
    }
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

/* ============================================================================
   BADGES - Ciblu Styled
   ============================================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary, .ciblu-badge {
    background-color: var(--ciblu-primary);
    color: white;
}

.badge-soft, .ciblu-badge-soft {
    background: rgba(var(--ciblu-primary-text-rgb), 0.10);
    color: var(--ciblu-primary-text);
    border: 1px solid rgba(var(--ciblu-primary-text-rgb), 0.20);
}

.badge-success {
    background-color: rgba(var(--success-rgb), 0.15);
    color: var(--success);
}

.badge-warning {
    background-color: rgba(var(--warning-rgb), 0.15);
    color: var(--warning-text);
}

.badge-info {
    background-color: rgba(var(--info-rgb), 0.15);
    color: var(--info-text);
}

.badge-danger {
    background-color: rgba(var(--danger-rgb), 0.15);
    color: var(--danger);
}

/* ============================================================================
   PAGE LAYOUT
   ============================================================================ */

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.page-content {
    padding: 1rem 0 2rem;
}

/* ============================================================================
   LIST ITEMS
   ============================================================================ */

.tournament-list {
    display: flex;
    flex-direction: column;
}

.tournament-list .list-item:last-child {
    margin-bottom: 0;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.list-item:hover {
    border-color: var(--ciblu-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.list-item-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.list-item-action {
    color: var(--text-secondary);
    font-size: 1.25rem;
    margin-left: 1rem;
}

/* Compact list item variant - for dense lists (100+ items) */
.list-item-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.875rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    margin-bottom: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.list-item-compact:hover {
    border-color: var(--ciblu-primary);
    background-color: var(--background);
}

.list-item-compact .list-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.list-item-compact .list-item-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-compact .list-item-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.list-item-compact .badge {
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
}

.list-item-compact .list-item-arrow {
    opacity: 0.4;
}

.list-item-compact:hover .list-item-arrow {
    opacity: 1;
}


