/* ============================================
   Base Styles - Open PRO / Nebula Inspired
   ============================================ */
* { box-sizing: border-box; }

body {
    background: var(--surface);
    color: var(--on-surface);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: var(--gradient-page);
    background-attachment: fixed;
    background-size: cover;
}

/* Global Link Resets - Modern clean style without distracting underlines */
a {
    text-decoration: none !important;
    color: inherit;
}
a:hover {
    text-decoration: none !important;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--on-surface);
    letter-spacing: -0.02em;
    margin-top: 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { 
    background: var(--border); 
    border-radius: var(--radius-pill);
    transition: var(--transition);
}
::-webkit-scrollbar-thumb:hover { 
    background: var(--on-surface-tertiary);
}

/* Utility Classes - Bootstrap/Tailwind Compatibility */
.text-muted { color: var(--on-surface-tertiary) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--accent-green) !important; }
.text-danger { color: var(--accent-red) !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }
.small { font-size: 0.75rem !important; }
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.flex-wrap { flex-wrap: wrap !important; }
.align-items-center { align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.p-3 { padding: 1rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.pt-0 { padding-top: 0 !important; }
.pt-2 { padding-top: 0.5rem !important; }
.pb-0 { padding-bottom: 0 !important; }
.w-100 { width: 100% !important; }
.border-0 { border: 0 !important; }
.text-center { text-align: center !important; }
.position-fixed { position: fixed !important; }
.top-0 { top: 0 !important; }
.bottom-0 { bottom: 0 !important; }
.end-0 { right: 0 !important; }
.z-50 { z-index: 50 !important; }
.opacity-0 { opacity: 0 !important; }
.opacity-100 { opacity: 1 !important; }

/* Tailwind Utility Classes */
.hidden { display: none !important; }
.flex { display: flex !important; }
.items-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mr-3 { margin-right: 1rem !important; }
.ml-1 { margin-left: 0.25rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.ml-3 { margin-left: 1rem !important; }
.text-sm { font-size: 0.875rem !important; }
.text-xs { font-size: 0.75rem !important; }
.text-lg { font-size: 1.125rem !important; }
.text-xl { font-size: 1.25rem !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }
.uppercase { text-transform: uppercase !important; }
.text-on-surface { color: var(--on-surface) !important; }
.text-on-surface-secondary { color: var(--on-surface-secondary) !important; }
.text-on-surface-tertiary { color: var(--on-surface-tertiary) !important; }
.text-primary-color { color: var(--primary) !important; }
.bg-surface { background-color: var(--surface) !important; }
.bg-surface-elevated { background-color: var(--surface-elevated) !important; }
.bg-surface-variant { background-color: var(--surface-variant) !important; }
.border-color { border-color: var(--border) !important; }
.border-subtle { border-color: var(--border-subtle) !important; }

/* Form Controls - Checkboxes, Radio, Toggles */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 1.5rem;
    padding-left: 0;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    vertical-align: top;
    appearance: none;
    background-color: var(--surface-variant);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    border: 1px solid var(--border);
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    flex-shrink: 0;
}

.form-check-input[type="checkbox"] {
    border-radius: 0.25rem;
}

.form-check-input[type="radio"] {
    border-radius: 50%;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

.form-check-input[type="radio"]:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e");
}

.form-check-input:focus {
    border-color: var(--primary);
    outline: 0;
    box-shadow: 0 0 0 0.25rem var(--primary-light);
}

.form-check-label {
    color: var(--on-surface);
    cursor: pointer;
    font-size: 0.875rem;
}

/* Form Switch */
.form-switch {
    padding-left: 0;
}

.form-switch .form-check-input {
    width: 2rem;
    height: 1rem;
    margin-left: 0;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%28255, 255, 255, 0.5%29'/%3e%3c/svg%3e");
    background-position: left center;
    border-radius: 2rem;
    transition: background-position 0.15s ease-in-out;
}

.form-switch .form-check-input:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.form-switch .form-check-input:checked {
    background-position: right center;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

/* Button Check (for platform filters) */
.btn-check {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

.btn-check:checked + .btn {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-check:focus + .btn {
    box-shadow: 0 0 0 0.25rem var(--primary-light);
}

/* Container fluid */
.container-fluid {
    width: 100%;
    padding-right: 1rem;
    padding-left: 1rem;
    margin-right: auto;
    margin-left: auto;
}

/* Search Highlight */
mark.search-highlight {
    background: rgba(59, 89, 120, 0.2);
    color: var(--primary);
    padding: 0 2px;
    border-radius: 2px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-card {
    text-align: center;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 0.85rem;
    font-size: 0.82rem;
    color: var(--on-surface-secondary);
}

/* Custom Close Button for Modals */
.btn-close {
    box-sizing: content-box;
    width: 12px;
    height: 12px;
    padding: 0.35rem;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236b7280'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/10px auto no-repeat !important;
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    opacity: 0.65;
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background-color: var(--surface-variant) !important;
    border-color: var(--border);
    opacity: 1;
}

.btn-close:focus {
    outline: 0;
    box-shadow: 0 0 0 2px var(--primary-light);
}

