/* Main Stylesheet for Family Wishlist App */

:root {
    /* Warm Plum & Gold Design System - Light Mode */
    --primary-color: #7c3aed;
    /* Plum - sophisticated, gift-oriented */
    --primary-hover: #6d28d9;
    --secondary-color: #ec4899;
    /* Rose - warm accent */
    --accent-color: #f59e0b;
    /* Gold - CTAs, celebrations */
    --accent-hover: #d97706;
    --success-color: #10b981;
    /* Emerald */
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #6366f1;
    /* Indigo */

    /* Surfaces - Warm Cream */
    --background-color: #faf8f5;
    --surface-color: #ffffff;
    --surface-elevated: #ffffff;

    /* Text - Warm Neutrals */
    --text-primary: #1c1917;
    /* Stone 900 */
    --text-secondary: #57534e;
    /* Stone 600 */
    --text-muted: #a8a29e;
    /* Stone 400 */

    /* Borders & Effects */
    --border-color: #e7e5e4;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(124, 58, 237, 0.1);
    --glass-blur: 12px;

    /* Shadows with warm tint */
    --shadow-sm: 0 1px 2px 0 rgba(28, 25, 23, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(28, 25, 23, 0.08), 0 2px 4px -1px rgba(28, 25, 23, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(28, 25, 23, 0.1), 0 4px 6px -2px rgba(28, 25, 23, 0.05);
    --shadow-glow: 0 0 30px rgba(124, 58, 237, 0.15);

    /* Radii */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;

    /* Sidebar */
    --sidebar-width: 72px;
    --sidebar-expanded: 240px;

    /* Typography */
    --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
}

/* Dark Mode - Warm Plum & Gold */
[data-theme="dark"] {
    --primary-color: #a78bfa;
    /* Light Plum */
    --primary-hover: #8b5cf6;
    --secondary-color: #f472b6;
    /* Light Rose */
    --accent-color: #fbbf24;
    /* Bright Gold */
    --accent-hover: #f59e0b;
    --success-color: #34d399;
    --danger-color: #f87171;
    --warning-color: #fbbf24;
    --info-color: #818cf8;

    /* Surfaces - Deep Warm Gray */
    --background-color: #1c1917;
    /* Stone 900 */
    --surface-color: #292524;
    /* Stone 800 */
    --surface-elevated: #44403c;
    /* Stone 700 */

    /* Text */
    --text-primary: #fafaf9;
    --text-secondary: #a8a29e;
    --text-muted: #78716c;

    /* Borders & Effects */
    --border-color: #44403c;
    --glass-bg: rgba(41, 37, 36, 0.85);
    --glass-border: rgba(167, 139, 250, 0.15);
    --glass-blur: 16px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(167, 139, 250, 0.25);
}

/* Base Styles */
* {
    font-family: var(--font-body);
}

/* Display Typography for Headings */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Hero and gradient text uses display font */
.gradient-text,
.hero-glass h1 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.03em;
}

/* Stat values use display font for impact */
.stat-value {
    font-family: var(--font-display);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
}

/* Background Atmosphere - Gradient Mesh */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 58, 237, 0.06), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(245, 158, 11, 0.04), transparent);
    pointer-events: none;
    z-index: -2;
}

/* Background Atmosphere - Subtle Noise Texture */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
    z-index: -1;
}

/* Dark mode background adjustments */
[data-theme="dark"] body::before {
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(167, 139, 250, 0.1), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(251, 191, 36, 0.06), transparent);
}

[data-theme="dark"] body::after {
    opacity: 0.03;
}

/* Skip to content link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Navbar */
.navbar {
    background-color: var(--surface-color) !important;
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color) !important;
    letter-spacing: -0.025em;
    transition: color 0.2s ease;
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary) !important;
    transition: color 0.2s ease;
    padding: 0.5rem 1rem !important;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
    border-radius: var(--radius-sm);
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: var(--background-color);
    border-color: var(--primary-color);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: var(--radius-md);
    padding: 0.625rem 1.25rem;
    transition: all 0.2s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.1);
}

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

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-secondary {
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    background: transparent;
}

.btn-outline-secondary:hover {
    background-color: var(--background-color);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    background-color: var(--surface-color);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-6px) scale(1.02);
}

.card-img-top {
    object-fit: cover;
    height: 220px;
    background: linear-gradient(135deg, var(--background-color) 0%, var(--border-color) 100%);
    transition: transform 0.3s ease;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

.card-header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

/* Feature Cards (homepage) */
.feature-card {
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--background-color) 100%);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-8px) scale(1.05);
}

.feature-card:hover .text-muted {
    color: rgba(255, 255, 255, 0.9) !important;
}

.feature-card:hover h3 {
    color: white;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    letter-spacing: 0.025em;
    transition: all 0.2s ease;
}

.badge-priority-high {
    background-color: var(--danger-color);
    color: white;
}

.badge-priority-medium {
    background-color: var(--warning-color);
    color: white;
}

.badge-priority-low {
    background-color: var(--info-color);
    color: white;
}

.status-pill {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.625rem;
}

/* Alerts / Toasts */
.alert {
    border-radius: var(--radius-md);
    border: none;
    box-shadow: var(--shadow-sm);
    animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--info-color);
}

/* Dark mode alert adjustments */
[data-theme="dark"] .alert-success {
    background-color: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

[data-theme="dark"] .alert-danger {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

[data-theme="dark"] .alert-warning {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

[data-theme="dark"] .alert-info {
    background-color: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

/* Forms */
.form-control,
.form-select {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.625rem 0.875rem;
    transition: all 0.2s ease;
    background-color: var(--surface-color);
    color: var(--text-primary);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background-color: var(--surface-color);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Search Input with Icon */
.search-wrapper {
    position: relative;
}

.search-wrapper .form-control {
    padding-left: 2.5rem;
}

.search-wrapper .search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* Filter Panel */
.filter-panel {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.filter-panel:hover {
    box-shadow: var(--shadow-md);
}

/* Tables */
.table {
    color: var(--text-primary);
}

.table-hover tbody tr {
    transition: background-color 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: var(--background-color);
}

/* Utilities */
.text-muted {
    color: var(--text-secondary) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow {
    box-shadow: var(--shadow-md) !important;
}

.rounded {
    border-radius: var(--radius-md) !important;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.fade-in-delay-1 {
    animation: fadeIn 0.5s ease 0.1s forwards;
    opacity: 0;
}

.fade-in-delay-2 {
    animation: fadeIn 0.5s ease 0.2s forwards;
    opacity: 0;
}

.fade-in-delay-3 {
    animation: fadeIn 0.5s ease 0.3s forwards;
    opacity: 0;
}

/* Image Loading Effect */
.img-loading {
    background: linear-gradient(90deg, var(--background-color) 0%, var(--border-color) 50%, var(--background-color) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ============================================
   ENTRANCE ANIMATIONS
   ============================================ */

/* Slide up with fade - primary entrance */
@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale up entrance */
@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pop entrance for CTAs */
@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    70% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Stagger utility - uses CSS custom property for delay */
.stagger-item {
    animation: slideUpFade 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(var(--stagger-index, 0) * 0.06s);
    opacity: 0;
}

/* Pop animation for buttons */
.animate-pop {
    animation: popIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0;
}

/* Hero-specific animation */
.hero-entrance {
    animation: slideUpFade 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0;
}

.hero-entrance-delayed {
    animation: slideUpFade 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
    opacity: 0;
}

/* Stat cards cascade */
.stat-cascade {
    animation: scaleUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0;
}

.stat-cascade:nth-child(1) { animation-delay: 0.1s; }
.stat-cascade:nth-child(2) { animation-delay: 0.15s; }
.stat-cascade:nth-child(3) { animation-delay: 0.2s; }
.stat-cascade:nth-child(4) { animation-delay: 0.25s; }

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .stagger-item,
    .animate-pop,
    .hero-entrance,
    .hero-entrance-delayed,
    .stat-cascade {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   CELEBRATION EFFECTS
   ============================================ */

/* Confetti container */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

/* Individual confetti pieces */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    opacity: 0;
}

.confetti--animation {
    animation: confetti-fall 3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes confetti-fall {
    0% {
        opacity: 1;
        transform: translateY(-20px) translateX(0) rotate(0deg) scale(1);
    }
    25% {
        opacity: 1;
        transform: translateY(25vh) translateX(calc(var(--confetti-drift, 0px) * 0.3)) rotate(180deg) scale(0.9);
    }
    50% {
        opacity: 0.8;
        transform: translateY(50vh) translateX(calc(var(--confetti-drift, 0px) * 0.6)) rotate(360deg) scale(0.8);
    }
    75% {
        opacity: 0.5;
        transform: translateY(75vh) translateX(calc(var(--confetti-drift, 0px) * 0.8)) rotate(540deg) scale(0.6);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) translateX(var(--confetti-drift, 0px)) rotate(720deg) scale(0.4);
    }
}

/* Confetti shapes */
.confetti--circle { border-radius: 50%; }
.confetti--square { border-radius: 2px; }
.confetti--triangle {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 10px solid currentColor;
    background: transparent !important;
}

/* Success pulse on buttons */
@keyframes successPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.btn-success-pulse {
    animation: successPulse 0.6s ease-out;
}

/* Card celebration glow */
@keyframes celebrationGlow {
    0% {
        box-shadow: var(--shadow-lg);
    }
    50% {
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.4), 0 0 60px rgba(16, 185, 129, 0.2);
    }
    100% {
        box-shadow: var(--shadow-lg);
    }
}

.card-celebrating {
    animation: celebrationGlow 1s ease-out;
}

/* Status change micro-interaction */
@keyframes statusChange {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.status-changed {
    animation: statusChange 0.3s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .confetti--animation,
    .btn-success-pulse,
    .card-celebrating,
    .status-changed {
        animation: none;
    }
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--background-color) 0%, var(--border-color) 50%, var(--background-color) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }

    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }

    .card-img-top {
        height: 180px;
    }

    .filter-panel {
        padding: 1rem;
    }

    .card:hover {
        transform: translateY(-2px) scale(1.01);
    }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Smooth transitions for theme switching */
* {
    transition-property: background-color, border-color, color;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

/* Preserve transition for interactive elements */
.btn,
.card,
.nav-link,
.form-control,
.form-select {
    transition: all 0.2s ease;
}

/* Hero Section */
.hero-section {
    animation: fadeIn 0.6s ease;
}

/* Empty State */
.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--background-color) 100%);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Print Styles */
@media print {

    .navbar,
    .btn,
    .filter-panel,
    .theme-toggle {
        display: none;
    }

    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Stat Cards */
.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

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

.stat-icon {
    font-size: 1.75rem;
    line-height: 1;
}

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

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.stat-secondary {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}

.stat-card-available {
    border-left: 4px solid var(--success-color);
}

.stat-card-claimed {
    border-left: 4px solid var(--warning-color);
}

.stat-card-purchased {
    border-left: 4px solid var(--primary-color);
}

/* Item Action Menu */
.item-actions-menu .dropdown-toggle {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
}

.item-actions-menu .dropdown-toggle:hover {
    background: var(--background-color);
    color: var(--text-primary);
}

.item-actions-menu .dropdown-toggle::after {
    display: none;
}

.item-actions-menu .dropdown-menu {
    min-width: 180px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    background: var(--surface-color);
}

.item-actions-menu .dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.item-actions-menu .dropdown-item:hover {
    background: var(--background-color);
}

.item-actions-menu .dropdown-divider {
    margin: 0.5rem 0;
    border-color: var(--border-color);
}

/* ============================================
   GLASSMORPHISM UTILITIES
   ============================================ */

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.glass-card:hover {
    box-shadow: var(--shadow-glow), var(--shadow-lg);
    transform: translateY(-4px);
}

/* Compact cards for masonry grid */
.glass-card.compact {
    max-height: 400px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.3s ease;
}

.glass-card.compact.expanded {
    max-height: none;
    overflow: visible;
}

.glass-card.compact::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, var(--surface-color));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.glass-card.compact.has-overflow::after {
    opacity: 1;
}

/* Truncate long titles */
.card-title-truncate {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   SIDEBAR NAVIGATION
   ============================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    z-index: 1000;
    transition: width 0.3s ease;
}

.sidebar:hover {
    width: var(--sidebar-expanded);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    margin-bottom: 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.sidebar-brand-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.sidebar-brand-text {
    opacity: 0;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.sidebar:hover .sidebar-brand-text {
    opacity: 1;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 0.75rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-link:hover {
    background: var(--background-color);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.sidebar-link-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.sidebar-link-text {
    opacity: 0;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.sidebar:hover .sidebar-link-text {
    opacity: 1;
}

.sidebar-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--danger-color);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    min-width: 18px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    transition: margin-left 0.3s ease;
}

/* ============================================
   ACCENT BUTTON (Coral CTA)
   ============================================ */

.btn-accent {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    border: none;
    font-weight: 600;
}

.btn-accent:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
    color: white;
}

/* ============================================
   FLOATING ACTION BUTTON
   ============================================ */

.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    border: none;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    text-decoration: none;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 30px rgba(249, 115, 22, 0.5);
    color: white;
}

/* ============================================
   STATUS DOTS
   ============================================ */

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot-available {
    background: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
}

.status-dot-claimed {
    background: var(--warning-color);
    box-shadow: 0 0 8px var(--warning-color);
}

.status-dot-purchased {
    background: var(--primary-color);
    box-shadow: 0 0 8px var(--primary-color);
}

/* ============================================
   ITEM GRID (using CSS Grid instead of columns)
   ============================================ */

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.masonry-grid>* {
    width: 100%;
}

/* Larger screens: limit max columns */
@media (min-width: 1400px) {
    .masonry-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

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

@media (max-width: 480px) {
    .masonry-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   MOBILE: Bottom Tab Bar
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding-bottom: 5rem;
    }

    .mobile-tabs {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--surface-color);
        border-top: 1px solid var(--border-color);
        display: flex;
        justify-content: space-around;
        padding: 0.5rem 0;
        z-index: 1000;
    }

    .mobile-tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        padding: 0.5rem 1rem;
        text-decoration: none;
        color: var(--text-secondary);
        font-size: 0.7rem;
        font-weight: 500;
    }

    .mobile-tab.active {
        color: var(--primary-color);
    }

    .mobile-tab-icon {
        font-size: 1.25rem;
    }

    .fab {
        bottom: 5rem;
    }
}

@media (min-width: 769px) {
    .mobile-tabs {
        display: none;
    }
}

/* ============================================
   MODAL FIXES
   ============================================ */

/* Ensure modals render above everything including sidebar */
.modal {
    z-index: 1060 !important;
}

.modal-backdrop {
    z-index: 1055 !important;
}

.modal-dialog {
    z-index: 1065 !important;
    pointer-events: auto !important;
}

.modal-content {
    pointer-events: auto !important;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom-color: var(--border-color);
}

.modal-body {
    color: var(--text-primary);
}

/* Dark mode modal support */
[data-theme="dark"] .modal-content {
    background: var(--surface-color);
    color: var(--text-primary);
}

[data-theme="dark"] .modal-header .btn-close {
    filter: invert(1);
}

/* Fix for dark mode input visibility */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--surface-color) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color);
}

[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] .form-select::placeholder {
    color: var(--text-muted);
}

/* Homepage Revamp Styles */
.hero-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    padding: 4rem 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.feature-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(34, 211, 238, 0.1);
    color: var(--primary-color);
    font-size: 2rem;
    margin: 0 auto 1.5rem;
    transition: all 0.3s ease;
}

.glass-card:hover .feature-icon {
    background: var(--primary-color);
    color: #ffffff;
    /* Use white text for contrast on primary background */
    transform: scale(1.1) rotate(5deg);
}

/* Event Date Badge */
.date-badge {
    background: rgba(34, 211, 238, 0.1);
    color: var(--primary-color);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    text-align: center;
    min-width: 80px;
    border: 1px solid var(--glass-border);
}

.date-badge .day {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.date-badge .month {
    display: block;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}