/* ============================================================================
   AVATAR
   ============================================================================ */

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--ciblu-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid var(--border);
    transition: border-color 0.2s ease;
}

.avatar:hover {
    border-color: var(--ciblu-primary);
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.25rem;
}

/* ============================================================================
   EMPTY STATE - Enhanced Ciblu Styled
   ============================================================================ */

.empty-state, .ciblu-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(var(--bs-primary-rgb), 0.04);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.10);
    border-radius: 0.75rem;
}

.empty-state-container {
    text-align: center;
    padding: 3rem 2rem 4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    max-width: 480px;
    margin: 0 auto;
}

.empty-state-container .empty-state-icon {
    color: var(--ciblu-primary-text);
    opacity: 0.6;
    margin-bottom: 1.5rem;
}

.empty-state-container .empty-state-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
}

.empty-state-container .empty-state-text {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 1.25rem;
}

.empty-state-email {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background-color: var(--surface-alt);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.empty-state-email svg {
    color: var(--text-secondary);
}

.empty-state-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.empty-state-divider::before,
.empty-state-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border);
}

.empty-state-hint {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0.75rem 0 0;
}

/* Button spinner for loading states */
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
}

.btn-secondary .btn-spinner {
    border-color: var(--border);
    border-top-color: var(--text-primary);
}

.patternbook-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(var(--ciblu-primary-text-rgb), 0.18);
    border-top-color: var(--ciblu-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.patternbook-download-status {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background-color: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.patternbook-download-status.error {
    background-color: rgba(var(--danger-rgb), 0.08);
    border-color: rgba(var(--danger-rgb), 0.2);
    color: var(--danger);
}

.patternbook-download-status.error .patternbook-spinner {
    border-color: rgba(var(--danger-rgb), 0.18);
    border-top-color: var(--danger);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.empty-state-text {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ============================================================================
   HERO
   ============================================================================ */

.hero-text {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.body-text {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================================================
   FILTER CHIPS
   ============================================================================ */

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-sort-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip:hover {
    background-color: var(--surface-alt);
    border-color: var(--gray-300);
}

.chip.active {
    background-color: var(--ciblu-primary);
    color: white;
    border-color: var(--ciblu-primary);
}

/* ============================================================================
   COMPETITION GROUP (Date > Location > Pruefungen)
   ============================================================================ */

.competition-group {
    margin-bottom: 1.5rem;
}

.competition-group-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.competition-location-group {
    margin-bottom: 0.75rem;
    margin-left: 0.25rem;
}

.competition-location-title {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    padding-left: 0.25rem;
}

/* ============================================================================
   PATTERN CARD
   ============================================================================ */

.pattern-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pattern-card:hover {
    border-color: var(--ciblu-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.pattern-card.selected {
    border-color: var(--ciblu-primary);
    border-width: 2px;
    background-color: rgba(var(--bs-primary-rgb), 0.04);
}

.pattern-thumbnail, .ciblu-thumb-wrap {
    width: 100%;
    aspect-ratio: 4/3;
    background-color: var(--surface-alt);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    font-size: 2rem;
}

/* ============================================================================
   PROGRESS INDICATOR
   ============================================================================ */

.progress-bar {
    height: 8px;
    background-color: var(--surface-alt);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--ciblu-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-bar-fill.complete {
    background-color: var(--success);
}

.progress-bar-fill.error {
    background-color: var(--danger);
}

.progress-bar-fill.warning {
    background-color: var(--warning);
}

/* ============================================================================
   IMPORT LOG
   ============================================================================ */

.import-log {
    max-height: 400px;
    overflow-y: auto;
    background-color: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
}

.import-log-entry {
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-secondary);
    padding: 1px 4px;
    border-radius: 2px;
}

.import-log-entry.log-new {
    color: var(--success);
}

.import-log-entry.log-updated {
    color: var(--info-text);
}

.import-log-entry.log-warning {
    color: var(--warning-text);
}

.import-log-entry.log-error {
    color: var(--danger);
    font-weight: 600;
}

/* ============================================================================
   MODAL / POPUP
   ============================================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--surface);
    border-radius: 0.75rem;
    padding: 1.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

.modal-content-lg {
    max-width: 600px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* ============================================================================
   ALERTS - Ciblu Styled
   ============================================================================ */

.ciblu-alert {
    background: rgba(var(--bs-primary-rgb), 0.06);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.12);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    color: var(--text-primary);
}

/* ============================================================================
   CIBLU LINKS
   ============================================================================ */

.ciblu-link {
    color: var(--ciblu-primary-text);
}

.ciblu-link:hover {
    color: var(--ciblu-secondary);
    text-decoration: underline;
}

.ciblu-icon-inline {
    margin-left: 0.35rem;
    opacity: 0.85;
}
