/* ============================================
   FRIENDS PORTAL - Main Stylesheet
   A cozy, modern design for friends
   ============================================ */

/* ====== CSS Variables ====== */
:root {
    /* Light Theme Colors */
    --bg-primary: #f8f9fc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f2f7;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f7fa;
    
    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.06);
    
    /* Accent Colors - slightly deeper for light bg */
    --accent-coral: #e85d5d;
    --accent-coral-light: #ff7070;
    --accent-mint: #2ebfb3;
    --accent-mint-light: #4ecdc4;
    --accent-gold: #e8a832;
    --accent-gold-light: #feca57;
    --accent-lavender: #7c6fef;
    --accent-lavender-light: #9990ff;
    --accent-rose: #e85d8c;
    
    /* Gradients */
    --gradient-coral: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    --gradient-mint: linear-gradient(135deg, #4ecdc4 0%, #38b2a5 100%);
    --gradient-gold: linear-gradient(135deg, #feca57 0%, #ff9f43 100%);
    --gradient-lavender: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    --gradient-rose: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
    --gradient-dark: linear-gradient(180deg, #f8f9fc 0%, #eef1f6 100%);
    
    /* Text Colors */
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a68;
    --text-muted: #7a7a8c;
    --text-hint: #a0a0b0;
    
    /* Borders & Shadows */
    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-light: rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
    --shadow-glow-coral: 0 4px 20px rgba(255, 107, 107, 0.25);
    --shadow-glow-mint: 0 4px 20px rgba(78, 205, 196, 0.25);
    --shadow-glow-gold: 0 4px 20px rgba(254, 202, 87, 0.3);
    
    /* Spacing */
    --sidebar-width: 280px;
    --header-height: 70px;
    --mobile-nav-height: 70px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(255, 107, 107, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(78, 205, 196, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(162, 155, 254, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Rubik', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

a {
    color: var(--accent-mint);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-mint-light);
}

/* ====== Sidebar ====== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    transition: transform var(--transition-slow);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.04);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-icon {
    font-size: 2rem;
    line-height: 1;
}

.logo-text {
    font-family: 'Rubik', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-coral);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.sidebar-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-section {
    padding: 0 1rem;
    margin-bottom: 1.5rem;
}

.nav-section-title {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-hint);
    padding: 0 1rem;
    margin-bottom: 0.75rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 0.25rem;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--gradient-coral);
    color: white;
    box-shadow: var(--shadow-glow-coral);
}

.nav-item i {
    font-size: 1.25rem;
    width: 1.5rem;
    text-align: center;
}

.nav-item-accent {
    background: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.25);
}

.nav-item-accent:hover {
    background: rgba(255, 107, 107, 0.2);
    color: var(--accent-coral);
}

.nav-item-accent-alt {
    background: rgba(78, 205, 196, 0.12);
    border: 1px solid rgba(78, 205, 196, 0.25);
}

.nav-item-accent-alt:hover {
    background: rgba(78, 205, 196, 0.2);
    color: var(--accent-mint);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.user-card-link {
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.user-card-link:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateX(4px);
}

.user-card-link.active {
    border-color: var(--accent-lavender);
    background: rgba(162, 155, 254, 0.1);
}

.user-card-arrow {
    color: var(--text-hint);
    font-size: 0.9rem;
    transition: transform var(--transition-fast);
}

.user-card-link:hover .user-card-arrow {
    transform: translateX(4px);
    color: var(--accent-lavender);
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--gradient-lavender);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Rubik', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.25);
    border-radius: var(--radius-md);
    color: var(--accent-coral);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    background: rgba(255, 107, 107, 0.18);
    color: var(--accent-coral);
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-login {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-login:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn-register {
    background: var(--gradient-mint);
    color: white;
}

.btn-register:hover {
    box-shadow: var(--shadow-glow-mint);
    color: white;
    transform: translateY(-2px);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ====== Main Content ====== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ====== Top Header ====== */
.top-header {
    height: var(--header-height);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.menu-toggle:hover {
    background: var(--bg-tertiary);
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.breadcrumb-link {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

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

.breadcrumb-link i {
    font-size: 1.1rem;
}

.breadcrumb-separator {
    color: var(--text-hint);
}

.breadcrumb-current {
    color: var(--text-secondary);
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ====== Notification Bell ====== */
.notification-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 1.25rem;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.notification-bell:hover {
    background: var(--bg-card-hover);
    color: var(--accent-lavender);
    transform: scale(1.05);
}

.notification-bell.has-unread {
    color: var(--accent-lavender);
    animation: bell-shake 0.5s ease-in-out;
}

.notification-bell.has-unread:hover {
    animation: none;
}

@keyframes bell-shake {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(12deg); }
    30% { transform: rotate(-12deg); }
    45% { transform: rotate(8deg); }
    60% { transform: rotate(-8deg); }
    75% { transform: rotate(4deg); }
    90% { transform: rotate(-4deg); }
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--gradient-coral);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}

.user-greeting {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.user-greeting strong {
    color: var(--accent-gold);
}

/* ====== Messages ====== */
.messages-container {
    padding: 1rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alert {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.alert-success {
    background: rgba(78, 205, 196, 0.12);
    border: 1px solid rgba(78, 205, 196, 0.35);
    color: #1a9085;
}

.alert-error, .alert-danger {
    background: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.35);
    color: #c54545;
}

.alert-warning {
    background: rgba(254, 202, 87, 0.15);
    border: 1px solid rgba(254, 202, 87, 0.4);
    color: #a67a20;
}

.alert-info {
    background: rgba(162, 155, 254, 0.12);
    border: 1px solid rgba(162, 155, 254, 0.35);
    color: #5a4fcf;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.1rem;
    transition: opacity var(--transition-fast);
}

.alert-close:hover {
    opacity: 1;
}

/* ====== Page Content ====== */
.page-content {
    flex: 1;
    padding: 2rem;
}

/* ====== Footer ====== */
.main-footer {
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-subtle);
}

/* ====== Mobile Navigation ====== */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-nav-height);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    z-index: 1000;
    padding: 0 1rem;
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    text-decoration: none;
    padding: 0 0.25rem;
}

.mobile-nav-item i {
    font-size: 1.25rem;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    color: var(--accent-coral);
}

.mobile-nav-item {
    position: relative;
}

.mobile-nav-badge {
    position: absolute;
    top: 0.15rem;
    right: 50%;
    transform: translateX(1rem);
    background: var(--accent-coral);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 1rem;
    height: 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.2rem;
}

/* ====== Cards ====== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-family: 'Rubik', sans-serif;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.card-text {
    color: var(--text-secondary);
}

/* Feature Cards */
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    transition: all var(--transition-slow);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-coral);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-light);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card.mint::before {
    background: var(--gradient-mint);
}

.feature-card.gold::before {
    background: var(--gradient-gold);
}

.feature-card.lavender::before {
    background: var(--gradient-lavender);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.feature-icon.coral {
    background: rgba(255, 107, 107, 0.12);
}

.feature-icon.mint {
    background: rgba(78, 205, 196, 0.12);
}

.feature-icon.gold {
    background: rgba(254, 202, 87, 0.18);
}

.feature-icon.lavender {
    background: rgba(162, 155, 254, 0.15);
}

.feature-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.feature-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* ====== Buttons ====== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

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

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

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

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

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

.btn-success:hover {
    box-shadow: var(--shadow-glow-mint);
    transform: translateY(-2px);
    color: white;
}

.btn-warning {
    background: var(--gradient-gold);
    color: var(--bg-primary);
}

.btn-warning:hover {
    box-shadow: var(--shadow-glow-gold);
    transform: translateY(-2px);
    color: var(--bg-primary);
}

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

.btn-danger:hover {
    box-shadow: var(--shadow-glow-coral);
    transform: translateY(-2px);
    color: white;
}

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

.btn-outline-primary:hover {
    background: rgba(255, 107, 107, 0.12);
    color: var(--accent-coral);
}

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

.btn-outline-success:hover {
    background: rgba(78, 205, 196, 0.12);
    color: var(--accent-mint);
}

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

.btn-outline-warning:hover {
    background: rgba(254, 202, 87, 0.15);
    color: var(--accent-gold);
}

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

.btn-outline-danger:hover {
    background: rgba(255, 107, 107, 0.12);
    color: var(--accent-coral);
}

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

.btn-outline-info:hover {
    background: rgba(162, 155, 254, 0.12);
    color: var(--accent-lavender);
}

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

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

.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* ====== Forms ====== */
.form-control,
.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-mint);
    box-shadow: 0 0 0 4px rgba(78, 205, 196, 0.15);
}

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

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
}

.form-card h2 {
    text-align: center;
    margin-bottom: 2rem;
    background: var(--gradient-coral);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ====== Page Headers ====== */
.page-header {
    padding: 2rem;
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -25%;
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.page-header.coral {
    background: var(--gradient-coral);
    box-shadow: var(--shadow-glow-coral);
}

.page-header.mint {
    background: var(--gradient-mint);
    box-shadow: var(--shadow-glow-mint);
}

.page-header.gold {
    background: var(--gradient-gold);
    box-shadow: var(--shadow-glow-gold);
}

.page-header.lavender {
    background: var(--gradient-lavender);
    box-shadow: 0 0 30px rgba(162, 155, 254, 0.3);
}

.page-header h1,
.page-header h2 {
    color: white;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

.page-header .btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    backdrop-filter: blur(10px);
}

.page-header .btn:hover {
    background: white;
    color: var(--bg-primary);
}

/* ====== Section Headers ====== */
.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.section-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.section-icon.coral {
    background: var(--gradient-coral);
}

.section-icon.mint {
    background: var(--gradient-mint);
}

.section-icon.gold {
    background: var(--gradient-gold);
}

.section-icon.lavender {
    background: var(--gradient-lavender);
}

.section-header h3,
.section-header h4 {
    margin: 0;
}

/* ====== Tables ====== */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.table thead th:first-child {
    border-radius: var(--radius-md) 0 0 0;
}

.table thead th:last-child {
    border-radius: 0 var(--radius-md) 0 0;
}

.table tbody td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

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

.table tbody tr:last-child td:first-child {
    border-radius: 0 0 0 var(--radius-md);
}

.table tbody tr:last-child td:last-child {
    border-radius: 0 0 var(--radius-md) 0;
}

/* ====== Badges ====== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-primary, .bg-primary {
    background: var(--gradient-coral) !important;
    color: white !important;
}

.badge-success, .bg-success {
    background: var(--gradient-mint) !important;
    color: white !important;
}

.badge-warning, .bg-warning {
    background: var(--gradient-gold) !important;
    color: var(--bg-primary) !important;
}

.badge-secondary, .bg-secondary {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
}

.badge-info, .bg-info {
    background: var(--gradient-lavender) !important;
    color: white !important;
}

/* ====== Empty States ====== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-card);
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-xl);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.empty-state p {
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

/* ====== Accordion ====== */
.accordion-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.accordion-button {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Rubik', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition-fast);
}

.accordion-button:hover {
    background: var(--bg-tertiary);
}

.accordion-button::after {
    content: '\F282';
    font-family: 'bootstrap-icons';
    font-size: 1rem;
    transition: transform var(--transition-normal);
}

.accordion-button:not(.collapsed)::after {
    transform: rotate(180deg);
}

.accordion-collapse {
    display: none;
}

.accordion-collapse.show {
    display: block;
}

.accordion-body {
    padding: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

/* ====== Grid System ====== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.75rem;
}

.col-md-4, .col-md-6, .col-lg-4, .col-lg-6 {
    padding: 0.75rem;
    width: 100%;
}

@media (min-width: 768px) {
    .col-md-4 { width: 33.333%; }
    .col-md-6 { width: 50%; }
}

@media (min-width: 1024px) {
    .col-lg-4 { width: 33.333%; }
    .col-lg-6 { width: 50%; }
}

/* ====== Utility Classes ====== */
.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--accent-coral) !important; }
.text-success { color: var(--accent-mint) !important; }
.text-warning { color: var(--accent-gold) !important; }
.text-danger { color: var(--accent-coral) !important; }
.text-info { color: var(--accent-lavender) !important; }
.text-dark { color: var(--text-primary) !important; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.5rem; }
.mt-auto { margin-top: auto; }
.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }
.ms-2 { margin-left: 0.5rem; }
.ms-auto { margin-left: auto; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.5rem; }
.py-5 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.pt-2 { padding-top: 0.5rem; }
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.border-0 { border: none; }
.border-top { border-top: 1px solid var(--border-subtle); }
.rounded-3 { border-radius: var(--radius-md); }
.rounded-4 { border-radius: var(--radius-lg); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow-md); }
.img-fluid { max-width: 100%; height: auto; }

.g-4 > * {
    margin-bottom: 1.5rem;
}

/* ====== Responsive ====== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-close {
        display: block;
    }
    
    .sidebar-overlay {
        display: block;
    }
    
    .sidebar-footer {
        padding-bottom: calc(1.5rem + var(--mobile-nav-height));
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .mobile-nav {
        display: flex;
    }
    
    .main-content {
        padding-bottom: var(--mobile-nav-height);
    }
    
    .page-content {
        padding: 1.5rem;
    }
    
    .top-header {
        padding: 0 1.5rem;
    }
    
    .user-greeting {
        display: none;
    }
}

@media (max-width: 640px) {
    .page-content {
        padding: 1rem;
    }
    
    .top-header {
        padding: 0 1rem;
        height: 60px;
    }
    
    .page-header {
        padding: 1.5rem;
        border-radius: var(--radius-lg);
    }
    
    .page-header h2 {
        font-size: 1.25rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .form-card {
        padding: 1.5rem;
    }
    
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

/* ====== Shopping Module Compatibility ====== */
.page-header.theme-purple {
    background: var(--gradient-lavender);
    box-shadow: 0 0 30px rgba(162, 155, 254, 0.3);
}

.page-header.theme-green {
    background: var(--gradient-mint);
    box-shadow: var(--shadow-glow-mint);
}

.page-header.theme-orange {
    background: var(--gradient-gold);
    box-shadow: var(--shadow-glow-gold);
}

.page-header.theme-blue {
    background: var(--gradient-lavender);
}

/* Shopping List Cards */
.list-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.list-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.list-card.own {
    border-left: 4px solid var(--accent-mint);
}

.list-card.shared {
    border-left: 4px solid var(--accent-lavender);
}

.list-card .card-body {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.list-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.list-avatar {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.list-card.own .list-avatar {
    background: rgba(78, 205, 196, 0.12);
    color: var(--accent-mint);
}

.list-card.shared .list-avatar {
    background: rgba(162, 155, 254, 0.12);
    color: var(--accent-lavender);
}

.list-name {
    font-family: 'Rubik', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.list-actions {
    display: flex;
    gap: 0.5rem;
}

/* Item Cards */
.item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.item-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.item-card.bought {
    border-left: 4px solid var(--accent-mint);
    background: rgba(78, 205, 196, 0.06);
}

.item-card:not(.bought) {
    border-left: 4px solid var(--accent-gold);
}

.item-title {
    font-family: 'Rubik', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
}

.price-info {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    margin: 0.75rem 0;
}

.price-main {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.price-unit {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.quantity-badge {
    background: var(--gradient-lavender);
    color: white;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
}

.person-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(162, 155, 254, 0.12);
    color: var(--accent-lavender);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
}

.person-badge.muted {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.85rem;
}

.status-badge.bought {
    background: var(--gradient-mint);
    color: white;
}

.status-badge.pending {
    background: var(--gradient-gold);
    color: var(--bg-primary);
}

/* Balance Badges */
.balance-positive {
    background: rgba(78, 205, 196, 0.12);
    color: #1a9085;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    display: inline-block;
}

.balance-negative {
    background: rgba(255, 107, 107, 0.12);
    color: #c54545;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    display: inline-block;
}

.balance-zero {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    display: inline-block;
}

/* Tables from shopping */
.balance-table {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.balance-table thead {
    background: linear-gradient(135deg, #1e293b, #334155);
}

.balance-table thead th {
    background: transparent;
    color: white;
    font-weight: 600;
    padding: 1rem 1.25rem;
    border: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.balance-table tbody tr {
    transition: background var(--transition-fast);
}

.balance-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.balance-table tbody td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    border-color: var(--border-subtle);
    color: var(--text-secondary);
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.spent-amount {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-lavender);
}

.transaction-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.transaction-list li {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

/* Repayment Cards */
.repayment-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 4px solid var(--accent-gold);
    transition: all var(--transition-normal);
}

.repayment-card:hover {
    background: var(--bg-card-hover);
    transform: translateX(8px);
}

.repayment-users {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.repayment-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.repayment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.repayment-avatar.from {
    background: rgba(255, 107, 107, 0.12);
    color: var(--accent-coral);
}

.repayment-avatar.to {
    background: rgba(78, 205, 196, 0.12);
    color: var(--accent-mint);
}

.repayment-arrow {
    font-size: 1.5rem;
    color: var(--accent-gold);
}

.repayment-amount {
    background: var(--gradient-gold);
    color: var(--bg-primary);
    font-weight: 700;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-full);
    font-size: 1rem;
}

/* Form Sections */
.form-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.form-section .section-header {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 1.25rem;
}

.form-section label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Section title/header from shopping */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.section-title h3 {
    margin: 0;
    font-weight: 700;
}

.section-icon.own { background: var(--gradient-mint); }
.section-icon.shared { background: var(--gradient-lavender); }
.section-icon.balance { background: var(--gradient-lavender); }
.section-icon.repayment { background: var(--gradient-gold); }
.section-icon.participant { background: var(--gradient-lavender); }
.section-icon.transaction { background: var(--gradient-mint); }

/* Action buttons in cards */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    margin-top: auto;
}

.action-buttons .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

/* Info boxes */
.info-box {
    background: rgba(162, 155, 254, 0.08);
    border: 1px solid rgba(162, 155, 254, 0.25);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--accent-lavender);
}

.info-box h6 {
    color: #5a4fcf;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.info-box p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tips-card {
    background: rgba(254, 202, 87, 0.1);
    border: 1px solid rgba(254, 202, 87, 0.3);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--accent-gold);
}

.tips-card h6 {
    color: #a67a20;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tips-card ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-secondary);
}

/* Success message */
.success-message {
    background: rgba(78, 205, 196, 0.1);
    border: 1px solid rgba(78, 205, 196, 0.3);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a9085;
}

/* Table responsive wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Button variants for shopping */
.btn-view {
    background: var(--gradient-lavender);
    color: white;
}

.btn-view:hover {
    box-shadow: 0 4px 20px rgba(162, 155, 254, 0.35);
    color: white;
}

.btn-delete {
    background: var(--gradient-coral);
    color: white;
}

.btn-delete:hover {
    box-shadow: var(--shadow-glow-coral);
    color: white;
}

.btn-mark-bought {
    background: var(--gradient-mint);
    color: white;
}

.btn-mark-bought:hover {
    box-shadow: var(--shadow-glow-mint);
    color: white;
}

.btn-save, .btn-add {
    background: var(--gradient-mint);
    color: white;
}

.btn-save:hover, .btn-add:hover {
    box-shadow: var(--shadow-glow-mint);
    color: white;
}

.btn-back {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn-back:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* Wish cards */
.card-wish {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.card-wish:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-light);
}

/* Empty state variations */
.empty-state.muted {
    background: var(--bg-card);
    border-style: dashed;
}

.empty-state.muted i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
    display: block;
}

.empty-state.muted p {
    color: var(--text-muted);
    font-weight: 500;
    margin: 0;
}

/* Lead text */
.lead {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Small text */
.small, small {
    font-size: 0.85rem;
}

/* Invalid feedback */
.invalid-feedback {
    color: var(--accent-coral);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* ====== Button Loading State ====== */
.btn.is-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.75;
    color: transparent !important;
}

.btn.is-loading::after {
    content: '';
    position: absolute;
    width: 1.25rem;
    height: 1.25rem;
    top: 50%;
    left: 50%;
    margin-left: -0.625rem;
    margin-top: -0.625rem;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-right-color: transparent;
    animation: btn-spinner 0.6s linear infinite;
}

.btn.is-loading.btn-primary::after,
.btn.is-loading.btn-success::after,
.btn.is-loading.btn-danger::after,
.btn.is-loading.btn-warning::after,
.btn.is-loading.btn-view::after,
.btn.is-loading.btn-mark-bought::after,
.btn.is-loading.btn-save::after,
.btn.is-loading.btn-add::after {
    border-color: rgba(255, 255, 255, 0.4);
    border-right-color: transparent;
}

.btn.is-loading.btn-secondary::after,
.btn.is-loading.btn-outline-primary::after,
.btn.is-loading.btn-outline-success::after,
.btn.is-loading.btn-outline-warning::after,
.btn.is-loading.btn-outline-danger::after,
.btn.is-loading.btn-back::after {
    border-color: var(--text-muted);
    border-right-color: transparent;
}

@keyframes btn-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Loading overlay for forms */
.form-loading-overlay {
    position: relative;
}

.form-loading-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(2px);
    border-radius: var(--radius-lg);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.form-loading-overlay.is-loading::before {
    opacity: 1;
    pointer-events: auto;
}

/* Opacity utilities */
.opacity-75 {
    opacity: 0.75;
}

/* Responsive adjustments for shopping */
@media (max-width: 768px) {
    .list-card .card-body {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .list-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .repayment-card {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .repayment-users {
        flex-direction: column;
    }
    
    .form-section {
        padding: 1.25rem;
    }
}
