/* ============================================================================
   UTILITIES
   ============================================================================ */

.text-primary { color: var(--ciblu-primary-text) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }

.bg-primary { background-color: var(--ciblu-primary) !important; }
.bg-surface { background-color: var(--surface) !important; }
.bg-surface-alt { background-color: var(--surface-alt) !important; }

.border-primary { border-color: var(--ciblu-primary) !important; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

.w-100 { width: 100%; }
.text-center { text-align: center; }

/* ============================================================================
   SVG ICONS
   ============================================================================ */

.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    vertical-align: middle;
}

.icon svg {
    display: block;
}

/* Back/Forward link styling */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--ciblu-primary-text);
    font-weight: 500;
    font-size: 0.9375rem;
    text-decoration: none;
    padding: 0.5rem 0;
    transition: all 0.2s ease;
}

.btn-back:hover {
    color: var(--ciblu-primary-text);
    text-decoration: none;
    opacity: 0.8;
}

.btn-back svg {
    transition: transform 0.2s ease;
}

.btn-back:hover svg {
    transform: translateX(-2px);
}

/* Forward arrow in list items */
.list-item-arrow {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.list-item:hover .list-item-arrow {
    color: var(--ciblu-primary-text);
    transform: translateX(2px);
}

/* Dropdown arrow */
.dropdown-chevron {
    display: flex;
    align-items: center;
    opacity: 0.8;
    transition: transform 0.2s ease;
}

/* ============================================================================
   LOADING SPINNER
   ============================================================================ */

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--ciblu-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}

/* ============================================================================
   PATTERN GRID
   ============================================================================ */

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

@media (max-width: 576px) {
    .pattern-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* ============================================================================
   PATTERN LIST (compact)
   ============================================================================ */

.pattern-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background-color: var(--border);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    overflow: hidden;
}

.pattern-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: var(--surface);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.pattern-list-item:hover {
    background-color: var(--surface-alt);
}

.pattern-list-item.selected {
    background-color: rgba(var(--bs-primary-rgb), 0.06);
    border-left: 3px solid var(--ciblu-primary);
    padding-left: calc(1rem - 3px);
}

.pattern-list-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background-color: rgba(var(--ciblu-primary-text-rgb), 0.08);
    color: var(--ciblu-primary-text);
    white-space: nowrap;
    flex-shrink: 0;
}

.pattern-list-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.pattern-list-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pattern-list-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.pattern-list-arrow {
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* ============================================================================
   PATTERN DETAIL (PDF preview)
   ============================================================================ */

.pattern-pdf-frame {
    width: 100%;
    height: 60vh;
    min-height: 400px;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background-color: var(--surface-alt);
}

.modal-content .pattern-pdf-frame {
    height: 50vh;
}

/* ============================================================================
   ACCOUNT PAGE STYLES
   ============================================================================ */

.account-card {
    background: linear-gradient(135deg, var(--ciblu-primary) 0%, var(--ciblu-primary-800) 100%);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    color: white;
}

.account-profile {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.account-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.account-info {
    flex: 1;
}

.account-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.account-email {
    font-size: 0.9375rem;
    opacity: 0.85;
    margin-bottom: 0.5rem;
}

.account-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
}

.card-header-simple {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.card-header-simple .card-title {
    margin: 0;
}

.card-header-simple svg {
    flex-shrink: 0;
}

/* Theme Options */
.theme-options {
    display: flex;
    gap: 0.75rem;
}

.theme-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    border-radius: 0.75rem;
    border: 2px solid var(--border);
    background-color: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.theme-option:hover {
    border-color: var(--gray-300);
    background-color: var(--surface-alt);
}

.theme-option.active {
    border-color: var(--ciblu-primary-text);
    background-color: rgba(var(--ciblu-primary-text-rgb), 0.06);
    color: var(--ciblu-primary-text);
}

/* About Info */
.about-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.about-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.about-row:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.about-label {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.about-value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9375rem;
}

/* Logout Button */
.btn-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.9375rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    color: var(--danger);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background-color: rgba(var(--danger-rgb), 0.08);
    border-color: var(--danger);
}

/* List item compact interaction styles (moved from app-components for size compliance) */
.list-item-compact .btn-clear-pattern {
    padding: 0.25rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.list-item-compact .btn-clear-pattern:hover {
    color: var(--danger);
    background-color: rgba(var(--danger-rgb), 0.1);
}

.list-item-compact .btn-icon-action {
    padding: 0.25rem;
    border: none;
    background: transparent;
    color: var(--ciblu-primary-text);
    cursor: pointer;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.list-item-compact .btn-icon-action:hover {
    background-color: rgba(var(--ciblu-primary-text-rgb), 0.1);
}

/* List group active (e.g., Arena selection) */
.list-group-item.active,
.list-group-item.active:focus,
.list-group-item.active:hover {
    background-color: var(--ciblu-primary) !important;
    border-color: var(--ciblu-primary) !important;
    color: #fff !important;
}

.list-group-item-action:hover,
.list-group-item-action:focus {
    background-color: rgba(var(--bs-primary-rgb), 0.06);
}
