/**
 * nooziq Platform - Global Design System
 * Consistent forms, spacing, sections, and components
 */

/* ============================================
   Design Tokens
   ============================================ */
:root {
    /* Colors */
    --black: #000;
    --white: #fff;
    --gray-50: #fafafa;
    --gray-100: #f4f4f5;
    --gray-200: #e4e4e7;
    --gray-300: #d4d4d8;
    --gray-400: #a1a1aa;
    --gray-500: #71717a;
    --gray-600: #52525b;
    --gray-700: #3f3f46;
    --gray-800: #27272a;
    --gray-900: #18181b;
    
    /* Brand */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-contrast: #ffffff;
    --success: #16a34a;
    --success-light: #f0fdf4;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --warning: #d97706;
    --warning-light: #fffbeb;
    
    /* Semantic */
    --bg: var(--gray-50);
    --surface: var(--white);
    --border: var(--gray-200);
    --text: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-muted: var(--gray-400);
    
    /* Typography */
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;
    
    /* Consistent gaps */
    --section-gap: 24px;
    --element-gap: 16px;
    --form-gap: 20px;
    --input-margin: 6px;
    
    /* Sizing */
    --input-height: 44px;
    --input-height-sm: 36px;
    --input-height-lg: 52px;
    --radius-full: 9999px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --form-radius: 8px; /* Consistent radius for all form inputs */
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 2px 4px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

/* ============================================
   Reset
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    height: 100%;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

/* Sticky Footer Layout */
body.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.site-wrapper > main {
    flex: 1 0 auto;
}

body.site-wrapper > .footer {
    flex-shrink: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover,
a:focus,
a:active {
    color: var(--primary-hover);
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
    border: none;
    outline: none;
}

/* Remove any focus outlines on images */
img:focus,
img:active {
    outline: none;
    border: none;
}

/* Remove focus outline on clickable images */
a img,
button img {
    outline: none;
    border: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

input, select, textarea, button {
    font-size: inherit;
    font-family: inherit;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: var(--space-xl) 0;
}

/* ============================================
   Layout
   ============================================ */
.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-sm { max-width: 540px; }
.container-md { max-width: 720px; }
.container-lg { max-width: 900px; }

.page-content {
    padding: var(--space-2xl) 0;
}

/* ============================================
   Header
   ============================================ */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    height: 60px;
    gap: var(--space-xl);
}

.logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.logo:hover {
    text-decoration: none;
}

.logo-image {
    height: 32px;
    width: auto;
}

.nav {
    display: flex;
    gap: var(--space-xs);
    margin-left: auto;
}

.nav-link {
    padding: var(--space-sm) var(--space-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-full);
    transition: all 0.15s;
}

.nav-link:hover {
    color: var(--text);
    background: var(--gray-100);
    text-decoration: none;
}

.nav-link.active {
    color: var(--primary-contrast);
    background: var(--primary);
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.balance {
    font-size: 14px;
    font-weight: 600;
    color: var(--success);
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
}

.profile-trigger {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border);
    background: var(--gray-100);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    transition: border-color 0.15s;
}

.profile-trigger:hover {
    border-color: var(--gray-300);
}

.profile-trigger img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.profile-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.15s;
    z-index: 200;
    overflow: hidden;
}

.profile-dropdown.open .profile-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-menu-header {
    padding: var(--space-lg);
    background: var(--gray-50);
    border-bottom: 1px solid var(--border);
}

.profile-info strong {
    display: block;
    font-size: 15px;
}

.profile-info .text-muted {
    font-size: 13px;
}

.profile-menu-section {
    padding: var(--space-sm);
}

.profile-menu-section + .profile-menu-section {
    border-top: 1px solid var(--border);
}

.profile-menu-item {
    display: block;
    padding: var(--space-sm) var(--space-md);
    color: var(--text);
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: background 0.1s;
}

.profile-menu-item:hover {
    background: var(--gray-100);
    text-decoration: none;
}

.profile-menu-item-highlight {
    color: var(--primary);
    font-weight: 500;
}

.profile-menu-label {
    padding: var(--space-sm) var(--space-md) var(--space-xs);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-menu-logout:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    padding: var(--space-2xl) 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
}

.social-links a {
    color: var(--text-secondary);
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
    margin-bottom: var(--space-lg);
}

h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
h5 { font-size: 14px; }

p {
    margin-bottom: var(--space-md);
}

p:last-child {
    margin-bottom: 0;
}

/* ============================================
   Section Module (Standard Card Pattern)
   ============================================ */
.section,
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--section-gap);
}

.section:last-child,
.card:last-child {
    margin-bottom: 0;
}

.section-header,
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border);
    min-height: 60px;
}

.section-title,
.card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.section-body,
.card-body {
    padding: var(--space-xl);
}

.section-footer,
.card-footer {
    padding: var(--space-lg) var(--space-xl);
    background: var(--gray-50);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================================
   Page Header - Always Left Aligned
   ============================================ */
.page-header {
    margin-bottom: var(--section-gap);
    text-align: left;
}

.page-header.page-header-centered {
    text-align: center;
}

.page-header.page-header-centered .page-title,
.page-header.page-header-centered .page-subtitle {
    text-align: center;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    text-align: left;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 0;
    text-align: left;
}

/* ============================================
   Buttons - Pill Style (Consistent Height)
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    height: var(--input-height);
    padding: 0 var(--space-xl);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

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

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

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

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

.btn-success:hover {
    background: #15803d;
}

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

.btn-danger:hover {
    background: #b91c1c;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--text);
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    padding: 0;
    height: auto;
    font-weight: 500;
}

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

/* Button sizes */
.btn-sm {
    height: var(--input-height-sm);
    padding: 0 var(--space-lg);
    font-size: 13px;
}

.btn-lg {
    height: var(--input-height-lg);
    padding: 0 var(--space-2xl);
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: var(--input-height);
    padding: 0;
}

.btn-icon.btn-sm {
    width: var(--input-height-sm);
}

/* ============================================
   Form Elements - Global Consistent Style
   Labels always above, proper spacing
   ============================================ */
.form-group {
    margin-bottom: var(--form-gap);
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label,
.form-group > label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    color: var(--text);
}

/* All form inputs - consistent styling with margins */
.form-input,
.form-select,
.form-textarea,
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="tel"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    height: var(--input-height);
    padding: 0 var(--space-lg);
    font-size: 15px;
    color: var(--text);
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--form-radius);
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin-top: var(--input-margin);
    margin-bottom: var(--input-margin);
    margin-right: var(--input-margin);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input::placeholder,
.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

/* Select with custom arrow */
.form-select,
select {
    padding-right: var(--space-3xl);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-lg) center;
    cursor: pointer;
}

/* Textarea */
.form-textarea,
textarea {
    height: auto;
    min-height: 120px;
    padding: var(--space-lg);
    border-radius: var(--form-radius);
    resize: vertical;
    line-height: 1.5;
}

/* Small inputs */
.form-input-sm,
.form-select-sm,
.form-control-sm {
    height: var(--input-height-sm);
    padding: 0 var(--space-md);
    font-size: 14px;
}

.form-select-sm {
    padding-right: var(--space-2xl);
    background-position: right var(--space-md) center;
}

/* Form hint text */
.form-hint,
.form-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* Form row - only for specific multi-column needs like payment */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--form-gap);
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Form Details (collapsible) */
.form-details {
    border: 1px solid var(--border);
    border-radius: var(--form-radius);
    margin-bottom: var(--form-gap);
}

.form-details-summary {
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    font-weight: 500;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-details-summary::-webkit-details-marker {
    display: none;
}

.form-details-summary::after {
    content: '+';
    font-size: 18px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.form-details[open] .form-details-summary::after {
    content: '−';
}

.form-details-content {
    padding: 0 var(--space-lg) var(--space-lg);
    border-top: 1px solid var(--border);
}

/* Input group (input + button) */
.input-group {
    display: flex;
    gap: var(--space-sm);
}

.input-group .form-input,
.input-group .form-select,
.input-group .form-control,
.input-group input,
.input-group select {
    flex: 1;
    min-width: 0;
}

/* Checkbox and Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    cursor: pointer;
}

.form-check:last-child {
    margin-bottom: 0;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: var(--space-xs);
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.form-check input[type="radio"] {
    border-radius: var(--radius-full);
}

.form-check label {
    margin-bottom: 0;
    cursor: pointer;
}

/* File input button styling */
.btn-file {
    position: relative;
    overflow: hidden;
}

.btn-file input[type="file"] {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 100%;
    min-height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* ============================================
   Tables - Always 100% width, consistent style
   ============================================ */
.table-wrapper {
    overflow-x: auto;
    margin-bottom: var(--element-gap);
}

.table-wrapper:last-child {
    margin-bottom: 0;
}

table,
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table th,
table td,
.table th,
.table td {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

table th,
.table th {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: var(--gray-50);
}

table tbody tr:hover,
.table tbody tr:hover {
    background: var(--gray-50);
}

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

/* ============================================
   Tabs - White Background, Brand Color Selected
   ============================================ */
.tabs {
    display: inline-flex;
    gap: var(--space-xs);
    padding: var(--space-xs);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    margin-bottom: var(--section-gap);
}

.tab {
    padding: var(--space-sm) var(--space-lg);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.tab:hover {
    color: var(--text);
    background: var(--gray-100);
}

.tab.active {
    color: var(--primary-contrast);
    background: var(--primary);
    box-shadow: none;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Tabs full width variant */
.tabs-full {
    display: flex;
    width: 100%;
}

.tabs-full .tab {
    flex: 1;
    text-align: center;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: var(--element-gap);
}

.alert:last-child {
    margin-bottom: 0;
}

.alert-info {
    background: var(--primary-light);
    color: var(--primary-hover);
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
}

.alert-danger,
.alert-error {
    background: var(--danger-light);
    color: var(--danger);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning);
}

/* ============================================
   Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 var(--space-sm);
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    color: var(--text-secondary);
}

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

.badge-secondary {
    background: var(--gray-100);
    color: var(--text-secondary);
}

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

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

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

/* Tier badges */
.tier-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tier-badge-bronze { background: #fef3c7; color: #92400e; }
.tier-badge-silver { background: #f3f4f6; color: #374151; }
.tier-badge-gold { background: #fef9c3; color: #a16207; }

/* ============================================
   Chips - Light grey, brand text, no stroke
   ============================================ */
.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--gray-100);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}

.chip:hover {
    background: var(--gray-200);
}

.chip-active {
    background: var(--gray-100);
    color: var(--primary);
}

.chip-inactive {
    background: var(--gray-100);
    color: var(--text-muted);
    opacity: 0.7;
}

.chip-inactive:hover {
    opacity: 1;
}

.chip-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: var(--danger);
    transition: all 0.15s;
}

.chip-delete:hover {
    background: var(--danger);
    color: var(--white);
}

.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    min-height: 40px;
}

/* ============================================
   Color Swatch - Circle filled with color
   ============================================ */
.color-swatch {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border);
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    flex-shrink: 0;
}

.color-swatch::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-swatch::-webkit-color-swatch {
    border: none;
    border-radius: var(--radius-full);
}

.color-swatch::-moz-color-swatch {
    border: none;
    border-radius: var(--radius-full);
}

input[type="color"] {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border);
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    background: transparent;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: var(--radius-full);
}

input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: var(--radius-full);
}

/* ============================================
   Modal - Consistent close button
   ============================================ */
.modal-overlay,
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal-overlay.active,
.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.95);
    transition: transform 0.2s;
}

.modal-overlay.active .modal,
.modal-backdrop.active .modal {
    transform: scale(1);
}

.modal-sm { max-width: 400px; }
.modal-lg { max-width: 640px; }
.modal-xl { max-width: 800px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

/* Modal close button - small, 1:1 ratio X */
.modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    font-size: 14px;
    line-height: 1;
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--text);
}

.modal-body {
    padding: var(--space-xl);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-xl);
    background: var(--gray-50);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================================
   Stats Grid
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--element-gap);
    margin-bottom: var(--section-gap);
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* ============================================
   Vote Buttons
   ============================================ */
.vote-btn-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.vote-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: var(--gray-400);
}

.vote-btn svg {
    width: 22px;
    height: 22px;
}

.vote-btn.vote-up:hover,
.vote-btn.vote-up.active {
    background: var(--success-light);
    border-color: var(--success);
    color: var(--success);
}

.vote-btn.vote-down:hover,
.vote-btn.vote-down.active {
    background: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
}

.vote-btn.vote-skip {
    width: 40px;
    height: 40px;
}

.vote-btn.vote-skip:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--text-secondary);
}

.vote-btn.vote-skip svg {
    width: 18px;
    height: 18px;
}

.vote-btn-lg {
    width: 64px;
    height: 64px;
}

.vote-btn-lg svg {
    width: 28px;
    height: 28px;
}

.vote-btn-sm {
    width: 36px;
    height: 36px;
}

.vote-btn-sm svg {
    width: 16px;
    height: 16px;
}

.vote-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 24px;
    text-align: center;
}

/* ============================================
   Song Cards - Global Consistent Style
   ============================================ */
.song-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--element-gap);
    width: 100%;
}

.song-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow 0.15s, transform 0.15s;
}

.song-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Song Card Media/Thumbnail */
.song-card-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--gray-100);
    cursor: pointer;
}

.song-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: none;
    outline: none;
}

/* Play button overlay */
.song-card-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: var(--white);
    border-radius: var(--radius-full);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.15s;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
}

.song-card-thumbnail:hover .song-card-play-btn {
    opacity: 1;
}

.song-card-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.song-card-play-btn svg {
    width: 24px;
    height: 24px;
    fill: var(--text);
    margin-left: 3px;
}

/* Score badge */
.song-card-score {
    position: absolute;
    bottom: var(--space-sm);
    right: var(--space-sm);
    background: rgba(0,0,0,0.8);
    color: var(--white);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
}

/* Video player container */
.song-card-video-player {
    aspect-ratio: 16/9;
    background: var(--black);
}

.song-card-video-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Embed player for Spotify/Apple Music/SoundCloud */
.embed-player {
    width: 100%;
    border: none;
    border-radius: 0;
}

/* Card body - consistent padding */
.song-card-body {
    padding: var(--space-lg);
}

/* Title and artist - can be left or centered */
.song-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--text);
}

.song-artist {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

/* Centered variant for vote page */
.song-card-body.text-center .song-title,
.song-card-body.text-center .song-artist {
    text-align: center;
}

/* Card footer */
.song-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border);
}

/* Card actions (vote buttons area) */
.song-card-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-xl);
    padding: var(--space-lg);
    border-top: 1px solid var(--border);
    background: var(--gray-50);
}

/* AI Labels */
.ai-labels {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.ai-label {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-weight: 500;
    background: var(--gray-100);
    color: var(--text-secondary);
}

.ai-label.ai_assisted {
    background: var(--warning-light);
    color: var(--warning);
}

.ai-label.ai_generated {
    background: var(--danger-light);
    color: var(--danger);
}

/* ============================================
   Video Container
   ============================================ */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    background: var(--black);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--element-gap);
}

.video-container:last-child {
    margin-bottom: 0;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ============================================
   List Items
   ============================================ */
.list-group {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.list-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background: var(--gray-50);
}

.list-item-thumb {
    width: 64px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--gray-100);
}

.list-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 500;
}

.list-item-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================
   Leaderboard
   ============================================ */
.leaderboard-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border);
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.rank {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.rank-1 { background: #fef9c3; color: #a16207; }
.rank-2 { background: #f3f4f6; color: #374151; }
.rank-3 { background: #fed7aa; color: #c2410c; }

.leaderboard-info {
    flex: 1;
    min-width: 0;
}

.leaderboard-name {
    font-weight: 500;
}

.leaderboard-stats {
    font-size: 13px;
    color: var(--text-muted);
}

.leaderboard-value {
    font-weight: 600;
    color: var(--primary);
}

/* Trending items */
.trending-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.trending-item:last-child {
    border-bottom: none;
}

.trending-item:hover {
    text-decoration: none;
}

.trending-thumb {
    width: 64px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--gray-100);
}

.trending-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trending-info {
    flex: 1;
    min-width: 0;
}

.trending-title {
    font-weight: 500;
}

.trending-artist {
    font-size: 13px;
    color: var(--text-muted);
}

.trending-score {
    font-weight: 600;
    font-size: 16px;
}

/* Homepage trending */
.trending-song-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.trending-song-item:last-child {
    border-bottom: none;
}

.trending-song-item:hover {
    text-decoration: none;
}

.trending-song-thumb {
    width: 64px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--gray-100);
}

.trending-song-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trending-song-info {
    flex: 1;
    min-width: 0;
}

.trending-song-title {
    font-weight: 500;
}

.trending-song-artist {
    font-size: 13px;
    color: var(--text-muted);
}

.trending-song-score {
    font-weight: 600;
    font-size: 16px;
}

/* ============================================
   Empty State - Centered with Icon
   ============================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
    color: var(--text-secondary);
    min-height: 300px;
}

.empty-state-icon {
    font-size: 64px;
    color: var(--primary);
    margin-bottom: var(--space-lg);
    opacity: 0.8;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-sm);
}

.empty-state-message {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    max-width: 400px;
}

.empty-state .btn {
    margin-top: var(--space-md);
}

/* ============================================
   Loading
   ============================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   Filter Row
   ============================================ */
.filter-row {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    align-items: flex-end; /* Align to bottom so button aligns with inputs */
    margin-bottom: var(--section-gap);
}

.filter-row .form-group {
    margin-bottom: 0;
}

.filter-row .form-input,
.filter-row .form-select,
.filter-row .form-control,
.filter-row input,
.filter-row select {
    flex: 1;
    min-width: 180px;
    margin: 0; /* Reset margins for alignment */
}

.filter-row .btn {
    flex-shrink: 0;
    margin: 0; /* Ensure no extra margin */
    height: var(--input-height); /* Match input height */
}

/* Inline form - button aligned with input */
.form-inline {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-inline .form-group {
    margin-bottom: 0;
}

.form-inline .form-input,
.form-inline .form-select,
.form-inline input,
.form-inline select {
    margin: 0;
}

.form-inline .btn {
    flex-shrink: 0;
    margin: 0;
    height: var(--input-height);
}

@media (max-width: 600px) {
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-row .form-input,
    .filter-row .form-select,
    .filter-row .form-control,
    .filter-row input,
    .filter-row select,
    .filter-row .btn {
        width: 100%;
    }
    
    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }
    .form-inline .form-input,
    .form-inline .form-select,
    .form-inline input,
    .form-inline select,
    .form-inline .btn {
        width: 100%;
    }
}

/* ============================================
   Homepage Hero - Configurable Layout
   ============================================ */

/* Full Width Background Hero */
.hero-fullwidth {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    margin-bottom: var(--section-gap);
}

.hero-fullwidth .container {
    position: relative;
    z-index: 2;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Contained Background Hero */
.hero-contained {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--section-gap);
}

.hero-contained .hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-contained .hero-section {
    position: relative;
    z-index: 2;
    margin-bottom: 0;
}

/* Base Hero Section */
.hero-section {
    padding: var(--space-3xl) var(--space-lg);
    margin-bottom: var(--section-gap);
}

/* Centered Hero (no image) */
.hero-section.hero-centered {
    text-align: center;
}

.hero-section.hero-centered .hero-text {
    max-width: 640px;
    margin: 0 auto;
}

.hero-section.hero-centered .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
}

.hero-section.hero-centered .hero-actions {
    justify-content: center;
}

/* Two Column Hero (with image) */
.hero-section.hero-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
    text-align: left;
}

.hero-section.hero-two-column .hero-text {
    order: 1;
}

.hero-section.hero-two-column .hero-image {
    order: 2;
}

.hero-section.hero-two-column .hero-actions {
    justify-content: flex-start;
}

/* Hero With Background */
.hero-section.hero-with-bg {
    padding: var(--space-3xl);
}

/* Hero Text Elements */
.hero-text {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.hero-title {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-top: var(--space-md);
}

/* Hero Image */
.hero-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section.hero-two-column {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-section.hero-two-column .hero-text {
        order: 2;
    }
    
    .hero-section.hero-two-column .hero-image {
        order: 1;
    }
    
    .hero-section.hero-two-column .hero-actions {
        justify-content: center;
    }
    
    .hero-section.hero-two-column .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-image img {
        max-width: 280px;
    }
}

.cta-section {
    text-align: center;
    padding: var(--space-2xl);
    background: var(--primary-light);
    border-radius: var(--radius-lg);
    margin-top: var(--section-gap);
}

.cta-section h2 {
    margin-bottom: var(--space-sm);
}

.cta-section p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

/* ============================================
   Profile Page
   ============================================ */
.profile-header {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.profile-avatar-large {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--gray-200);
    flex-shrink: 0;
}

.profile-avatar-large-placeholder {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-full);
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.profile-details h2 {
    margin-bottom: var(--space-xs);
}

.profile-details .text-muted {
    margin-bottom: var(--space-sm);
}

/* ============================================
   Band Hero
   ============================================ */
.band-hero {
    position: relative;
    min-height: 280px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border-radius: var(--radius-lg);
    margin-bottom: var(--section-gap);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-xl);
    color: var(--white);
    overflow: hidden;
}

.band-hero.has-image {
    background-size: cover;
    background-position: center;
}

.band-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.2) 100%);
}

.band-hero-content {
    position: relative;
    z-index: 1;
}

.band-logo {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    border: 3px solid var(--white);
    object-fit: cover;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--space-md);
}

.band-name {
    font-size: 32px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: var(--space-sm);
}

.band-tagline {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: var(--space-md);
}

.band-meta {
    display: flex;
    gap: var(--space-lg);
    font-size: 14px;
    opacity: 0.85;
    flex-wrap: wrap;
}

/* ============================================
   Members Grid
   ============================================ */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--element-gap);
}

.member-card {
    text-align: center;
    padding: var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.member-avatar {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    margin: 0 auto var(--space-md);
    object-fit: cover;
    background: var(--gray-200);
}

.member-name {
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.member-role {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================
   Review Items
   ============================================ */
.review-item {
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--border);
}

.review-item:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-sm);
}

.review-author {
    font-weight: 500;
}

.review-rating {
    font-weight: 600;
    font-size: 18px;
}

.review-ratings {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin: var(--space-md) 0;
}

.review-rating-item {
    background: var(--gray-100);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 13px;
}

.review-comment {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.review-date {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: var(--space-sm);
}

.creator-response {
    background: var(--primary-light);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    margin-top: var(--space-md);
}

.creator-response strong {
    color: var(--primary-hover);
}

/* ============================================
   Comments
   ============================================ */
.comment-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
    background: var(--gray-200);
}

.comment-content {
    flex: 1;
}

.comment-author {
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.comment-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.comment-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* ============================================
   Lyrics
   ============================================ */
.lyrics-section {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-top: var(--space-lg);
}

.lyrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
}

.lyrics-content {
    margin-top: var(--space-md);
    font-family: Georgia, serif;
    white-space: pre-wrap;
    line-height: 1.8;
}

/* ============================================
   Formatted Text
   ============================================ */
.formatted-text p {
    margin-bottom: var(--space-md);
}

.formatted-text p:last-child {
    margin-bottom: 0;
}

/* ============================================
   Grid Layouts
   ============================================ */
.grid {
    display: grid;
    gap: var(--section-gap);
    align-items: stretch;
    margin-bottom: var(--section-gap);
}

.grid:last-child {
    margin-bottom: 0;
}

.grid > .section,
.grid > .card {
    margin-bottom: 0;
    height: 100%;
}

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

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--section-gap);
}

.pagination .btn {
    min-width: var(--input-height);
}

.pagination .btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* ============================================
   Upload Controls
   ============================================ */
.upload-controls {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.upload-controls .form-input,
.upload-controls input {
    flex: 1;
}

/* ============================================
   Show Cards (Events)
   ============================================ */
.show-card {
    padding: var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.show-card:last-child {
    margin-bottom: 0;
}

.show-card.past {
    opacity: 0.6;
}

/* ============================================
   Posts Grid
   ============================================ */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--element-gap);
}

.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow 0.15s;
}

.post-card:hover {
    box-shadow: var(--shadow);
}

.post-card-image {
    aspect-ratio: 16/9;
    background: var(--gray-100);
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-body {
    padding: var(--space-lg);
}

.post-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.post-card-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.post-card-meta {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================
   Error State
   ============================================ */
.error-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
}

.error-state h2 {
    margin-bottom: var(--space-sm);
}

.error-state p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

/* ============================================
   Utilities
   ============================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }

.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

.mt-0 { margin-top: 0; }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

.mb-0 { margin-bottom: 0; }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

.ml-sm { margin-left: var(--space-sm); }
.ml-md { margin-left: var(--space-md); }
.ml-lg { margin-left: var(--space-lg); }
.ml-auto { margin-left: auto; }

.my-lg { margin-top: var(--space-lg); margin-bottom: var(--space-lg); }
.my-xl { margin-top: var(--space-xl); margin-bottom: var(--space-xl); }

/* Horizontal Rules - Consistent with borders */
hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: var(--space-lg) 0;
}

hr.my-lg {
    margin: var(--space-lg) 0;
}

hr.my-xl {
    margin: var(--space-xl) 0;
}

.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

.text-center { text-align: center; }
.text-right { text-align: right; }

.text-xs { font-size: 12px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 15px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 22px; }
.text-2xl { font-size: 28px; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.hidden { display: none !important; }
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.w-full { width: 100%; }
.w-auto { width: auto; }
.min-w-0 { min-width: 0; }

.border { border: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.rounded { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.bg-surface { background: var(--surface); }
.bg-muted { background: var(--gray-50); }

.cursor-pointer { cursor: pointer; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    :root {
        --section-gap: 20px;
        --element-gap: 12px;
    }
    
    .nav {
        display: none;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    
    .section-body,
    .card-body {
        padding: var(--space-lg);
    }
    
    .section-header,
    .card-header {
        padding: var(--space-md) var(--space-lg);
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-slide-in {
    animation: slideIn 0.2s ease;
}

.animate-fade-in {
    animation: fadeIn 0.2s ease;
}
