/**
 * SocializeTogether - Responsive Stylesheet
 * Mobile-first responsive design with Bootstrap 5
 */

/* --------------------------------------------------------
   Root Variables for Theming
   -------------------------------------------------------- */
:root {
    --primary-color: #0d9488;
    --secondary-color: #0f766e;
    --success-color: #48bb78;
    --danger-color: #f56565;
    --warning-color: #ed8936;
    --info-color: #4299e1;
    --light-color: #f7fafc;
    --dark-color: #2d3748;
    --text-color: #2d3748;
    --border-radius: 0.5rem;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* --------------------------------------------------------
   Base Styles
   -------------------------------------------------------- */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
                 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

* {
    box-sizing: border-box;
}

/* --------------------------------------------------------
   Typography Responsive Scaling
   -------------------------------------------------------- */
h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 600;
    margin-bottom: 0.875rem;
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

h4 {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    font-weight: 500;
}

p {
    font-size: clamp(0.875rem, 2vw, 1rem);
}

/* --------------------------------------------------------
   Navigation Responsive
   -------------------------------------------------------- */
.navbar-brand {
    font-weight: 700;
    font-size: clamp(1.25rem, 3vw, 1.5rem);
}

/* Mobile menu improvements */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
        padding: 1rem;
        border-radius: var(--border-radius);
        margin-top: 1rem;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 0.25rem;
        margin: 0.25rem 0;
    }

    .navbar-nav .nav-link:hover {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* --------------------------------------------------------
   Card Components
   -------------------------------------------------------- */
.card {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: none;
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    background: transparent;
    color: inherit;
    font-weight: 600;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    border-bottom: 1px solid #212529;
}

/* --------------------------------------------------------
   Buttons Responsive
   -------------------------------------------------------- */
.btn {
    border-radius: var(--border-radius);
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

/* Mobile button adjustments */
@media (max-width: 575.98px) {
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .btn-group-sm .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }

    /* Stack buttons vertically on small screens */
    .btn-toolbar .btn-group {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn-toolbar .btn {
        width: 100%;
    }
}

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

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

/* --------------------------------------------------------
   Forms Responsive
   -------------------------------------------------------- */
.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    transition: var(--transition);
    font-size: 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 148, 136, 0.2);
}

/* Mobile form improvements */
@media (max-width: 575.98px) {
    .form-control, .form-select {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 0.625rem 0.875rem;
    }

    .form-label {
        font-size: 0.875rem;
        font-weight: 500;
    }
}

/* --------------------------------------------------------
   Tables Responsive
   -------------------------------------------------------- */
.table-responsive {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* Improve table on mobile */
@media (max-width: 767.98px) {
    .table {
        font-size: 0.875rem;
    }

    .table thead {
        display: none;
    }

    .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: var(--border-radius);
        box-shadow: var(--box-shadow);
    }

    .table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.75rem;
        border: none;
        border-bottom: 1px solid #f7fafc;
    }

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

    .table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 1rem;
    }

    /* Button groups in tables */
    .table .btn-group {
        display: flex;
        gap: 0.25rem;
    }
}

/* --------------------------------------------------------
   Modals Responsive
   -------------------------------------------------------- */
@media (max-width: 575.98px) {
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-content {
        border-radius: var(--border-radius);
    }

    .modal-header, .modal-footer {
        padding: 1rem;
    }

    .modal-body {
        padding: 1.25rem;
    }
}

/* --------------------------------------------------------
   Stats Cards
   -------------------------------------------------------- */
.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.stat-card .stat-value {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card .stat-label {
    font-size: clamp(0.875rem, 2vw, 1rem);
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --------------------------------------------------------
   Alerts Responsive
   -------------------------------------------------------- */
.alert {
    border-radius: var(--border-radius);
    border-left: 4px solid;
    padding: 1rem 1.25rem;
}

@media (max-width: 575.98px) {
    .alert {
        font-size: 0.875rem;
        padding: 0.875rem 1rem;
    }
}

/* --------------------------------------------------------
   Badge Enhancements
   -------------------------------------------------------- */
.badge {
    padding: 0.375rem 0.625rem;
    border-radius: 0.25rem;
    font-weight: 500;
    font-size: 0.8125rem;
}

@media (max-width: 575.98px) {
    .badge {
        font-size: 0.75rem;
        padding: 0.3125rem 0.5rem;
    }
}

/* --------------------------------------------------------
   Grid System Improvements
   -------------------------------------------------------- */
@media (max-width: 767.98px) {
    .row > [class*='col-'] {
        margin-bottom: 1rem;
    }

    .row > [class*='col-']:last-child {
        margin-bottom: 0;
    }
}

/* --------------------------------------------------------
   Utility Classes
   -------------------------------------------------------- */

/* Responsive spacing */
.section-padding {
    padding: clamp(2rem, 5vw, 4rem) 0;
}

.container-padding {
    padding: clamp(1rem, 3vw, 2rem);
}

/* Responsive text alignment */
@media (max-width: 767.98px) {
    .text-md-start {
        text-align: start !important;
    }

    .text-md-center {
        text-align: center !important;
    }

    .text-md-end {
        text-align: end !important;
    }
}

/* Hide on mobile */
.hide-mobile {
    display: block;
}

@media (max-width: 767.98px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Show only on mobile */
.show-mobile {
    display: none;
}

@media (max-width: 767.98px) {
    .show-mobile {
        display: block !important;
    }
}

/* --------------------------------------------------------
   Loading States
   -------------------------------------------------------- */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* --------------------------------------------------------
   Animation Classes
   -------------------------------------------------------- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 500px;
        opacity: 1;
    }
}

.slide-down {
    animation: slideDown 0.3s ease-out;
}

/* --------------------------------------------------------
   Print Styles
   -------------------------------------------------------- */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
    }

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

    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* --------------------------------------------------------
   Accessibility Improvements
   -------------------------------------------------------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus styles */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline-offset: 4px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --------------------------------------------------------
   Dark Mode Support (Optional)
   -------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode
    :root {
        --text-color: #f7fafc;
        --light-color: #2d3748;
        --dark-color: #f7fafc;
    }

    body {
        background: #1a202c;
        color: var(--text-color);
    }

    .card {
        background: #2d3748;
        color: var(--text-color);
    }

    .form-control, .form-select {
        background: #1a202c;
        color: var(--text-color);
        border-color: #4a5568;
    }
    */
}

/* ========================================================
   Chapter Customization Styles
   ======================================================== */

/* CSS Variables for Chapter Theming */
:root {
    --custom-background: #ffffff;
    --custom-button: #0d9488;
    --custom-text: #2d3748;
    --custom-header: #0d9488;
}

/* Chapter-specific theme application */
body.chapter-page {
    background-color: var(--custom-background);
    color: var(--custom-text);
}

body.chapter-page .chapter-header {
    background: linear-gradient(135deg, var(--custom-header) 0%, var(--custom-button) 100%);
}

body.chapter-page .btn-primary {
    background-color: var(--custom-button);
    border-color: var(--custom-button);
}

body.chapter-page .btn-primary:hover {
    background-color: color-mix(in srgb, var(--custom-button) 85%, black);
    border-color: color-mix(in srgb, var(--custom-button) 85%, black);
}

body.chapter-page .btn-primary:focus {
    box-shadow: 0 0 0 0.25rem rgba(from var(--custom-button) r g b / 25%);
}

/* Additional theme elements */
body.chapter-page .card {
    border: 1px solid #212529;
}

body.chapter-page .card-header {
    background: transparent;
    color: inherit;
    border-bottom: 1px solid #212529;
}

body.chapter-page .card-header h5,
body.chapter-page .card-header h6 {
    color: #212529;
}

/* Admin tab cards */
.admin-tab-card {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    opacity: 0.6;
}

.admin-tab-card:hover {
    transform: translateY(-2px);
    opacity: 0.85;
}

.admin-tab-card.active {
    opacity: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

body.chapter-page .nav-link.active {
    color: var(--custom-button) !important;
}

body.chapter-page .text-primary {
    color: var(--custom-button) !important;
}

body.chapter-page .btn-outline-primary {
    color: var(--custom-button);
    border-color: var(--custom-button);
}

body.chapter-page .btn-outline-primary:hover {
    background-color: var(--custom-button);
    border-color: var(--custom-button);
    color: white;
}

body.chapter-page h1, body.chapter-page h2, body.chapter-page h3,
body.chapter-page h4, body.chapter-page h5, body.chapter-page h6 {
    color: var(--custom-header);
}

body.chapter-page .stat-card {
    border-left-color: var(--custom-button) !important;
}

/* Background Image Support (MySpace-style) */
body.chapter-page.has-background-image {
    position: relative;
}

/* Background container - starts at bottom of banner, scrolls with page */
body.chapter-page.has-background-image .chapter-background-layer {
    position: absolute;
    left: 0;
    width: 100%;
    bottom: 0;
    z-index: -1;
    background-color: var(--custom-background);
    background-image: var(--custom-background-image);
    background-position: center top;
    pointer-events: none;
    /* Top position set by JS based on banner height - bottom: 0 ensures full coverage */
}

/* Stretch mode - cover entire viewport */
body.chapter-page.bg-mode-cover .chapter-background-layer {
    background-size: cover;
    background-repeat: no-repeat;
}

/* Tile mode - repeat pattern */
body.chapter-page.bg-mode-tile .chapter-background-layer {
    background-size: auto;
    background-repeat: repeat;
}

/* Dark overlay for better text readability */
body.chapter-page.has-background-image.bg-overlay .chapter-background-layer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

/* Ensure content is readable over background */
body.chapter-page.has-background-image .card {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
}

/* Keep navbar solid - no background behind it */
body.chapter-page.has-background-image .navbar {
    background-color: #ffffff !important;
    position: relative;
    z-index: 10;
}

/* Keep banner/header area solid white to cover background */
body.chapter-page.has-background-image .chapter-header {
    position: relative;
    z-index: 5;
    background-color: #ffffff;
}

/* The banner image itself should show */
body.chapter-page.has-background-image .chapter-banner {
    position: relative;
    z-index: 6;
}

/* Dark theme adjustments for background images */
body.chapter-page.has-background-image.bg-overlay .card {
    background-color: rgba(255, 255, 255, 0.9);
}

/* Logo styling - Prominent sidebar display */
.chapter-logo-container {
    margin-bottom: 2rem;
    text-align: center;
}

.chapter-logo-container .card-body {
    padding: 0;
}

.chapter-logo {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

/* Sidebar spacing for left-side layout */
@media (min-width: 992px) {
    .col-lg-4.order-lg-1 {
        padding-right: 2rem;
    }
}

/* Banner styling - Full width hero image */
.chapter-banner {
    width: 100vw;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    object-position: center;
    display: block;
    margin: 0;
    padding: 0;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

/* Image framer swatches */
.cropper-swatch {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    border: 2px solid #dee2e6;
    cursor: pointer;
    padding: 0;
    transition: border-color 0.15s, transform 0.15s;
    flex-shrink: 0;
}

.cropper-swatch:hover {
    border-color: #adb5bd;
    transform: scale(1.15);
}

.cropper-swatch.active {
    border-color: #0d9488;
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.35);
}

.cropper-color-input {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    border: 2px solid #dee2e6;
    cursor: pointer;
    padding: 1px;
    flex-shrink: 0;
}

/* Cropper modal styles */
#cropper-modal .modal-dialog {
    max-width: 800px;
}

#cropper-modal .cropper-container {
    max-height: 500px;
    margin: 0 auto;
}

.cropper-view-box {
    outline: 1px solid var(--primary-color);
}

/* Theme preset cards */
.theme-preset-card {
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.theme-preset-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.12);
}

.theme-preset-card.active {
    border-color: var(--primary-color);
    background-color: rgba(13, 148, 136, 0.05);
}

/* Color swatches */
.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 2px solid #e2e8f0;
    display: inline-block;
}

/* Color picker display */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.color-picker-preview {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-picker-preview:hover {
    transform: scale(1.05);
}

input[type="color"] {
    width: 60px;
    height: 48px;
    border-radius: 6px;
    border: 2px solid #e2e8f0;
    cursor: pointer;
}

/* Image preview containers */
.image-preview-container {
    position: relative;
    display: inline-block;
}

.image-preview-container img {
    max-width: 100%;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.image-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 8px;
}

.image-preview-container:hover .image-preview-overlay {
    opacity: 1;
}

/* Loading spinner */
#customization-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}

#customization-loader.show {
    display: flex;
}

/* Customization modal tabs */
#customization-modal .nav-tabs .nav-link {
    color: #6c757d;
    border: none;
    border-bottom: 3px solid transparent;
}

#customization-modal .nav-tabs .nav-link:hover {
    border-bottom-color: var(--primary-color);
}

#customization-modal .nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: transparent;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chapter-logo {
        max-width: 150px;
    }

    .chapter-logo-container {
        margin-bottom: 1.5rem;
    }

    .chapter-banner {
        max-height: 250px;
    }

    #cropper-modal .cropper-container {
        max-height: 300px;
    }

    .color-picker-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .theme-preset-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .chapter-logo {
        max-width: 120px;
        padding: 0.75rem;
    }

    .chapter-logo-container {
        margin-bottom: 1rem;
    }

    .chapter-banner {
        max-height: 200px;
    }

    .color-swatch {
        width: 24px;
        height: 24px;
    }
}

/* ===========================================
   MOBILE BOTTOM NAVIGATION BAR
   Edit these variables to theme the bottom bar
   =========================================== */
:root {
    --bottom-bar-bg: #ffffff;
    --bottom-bar-border: rgba(13, 148, 136, 0.12);
    --bottom-bar-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    --bottom-bar-tab-color: #6c757d;
    --bottom-bar-tab-active: #0d9488;
    --bottom-bar-tab-size: 0.7rem;
    --bottom-bar-icon-size: 1.4rem;
    --bottom-bar-height: 70px;
}

@media (max-width: 991.98px) {
    /* Body padding is set inline on pages with bottom bar */

    .mobile-bottom-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bottom-bar-bg);
        border-top: 1px solid var(--bottom-bar-border);
        box-shadow: var(--bottom-bar-shadow);
        z-index: 1040;
        padding: 0.5rem 0;
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    }

    .mobile-tab {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0.5rem;
        color: var(--bottom-bar-tab-color);
        text-decoration: none;
        font-size: var(--bottom-bar-tab-size);
        font-weight: 600;
        transition: all 0.2s ease;
        border: none;
        background: none;
        cursor: pointer;
    }

    .mobile-tab i {
        font-size: var(--bottom-bar-icon-size);
        margin-bottom: 0.25rem;
        transition: transform 0.2s ease;
    }

    .mobile-tab:hover,
    .mobile-tab.active {
        color: var(--bottom-bar-tab-active);
    }

    .mobile-tab:hover i,
    .mobile-tab.active i {
        transform: scale(1.1);
    }

    .mobile-tab span {
        line-height: 1.2;
    }
}

@media (min-width: 992px) {
    .mobile-bottom-bar {
        display: none !important;
    }
}

/* ===========================================
   NAV PROFILE AVATAR
   =========================================== */
.nav-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bottom-bar-tab-active, #0d9488);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.15rem;
    background-size: cover;
    background-position: center;
}

/* ===========================================
   BOTTOM SHEETS (Mobile Popups)
   Edit these variables to theme bottom sheets
   =========================================== */
:root {
    --bottom-sheet-bg: #ffffff;
    --bottom-sheet-header-bg: #f8f9fa;
    --bottom-sheet-border-radius: 20px;
    --bottom-sheet-max-height: 75vh;
}

@media (max-width: 991.98px) {
    .bottom-sheet-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1050;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .bottom-sheet-overlay.show {
        display: block;
        opacity: 1;
    }

    .bottom-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bottom-sheet-bg);
        border-radius: var(--bottom-sheet-border-radius) var(--bottom-sheet-border-radius) 0 0;
        z-index: 1060;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        max-height: var(--bottom-sheet-max-height);
        display: flex;
        flex-direction: column;
    }

    .bottom-sheet.show {
        transform: translateY(0);
    }

    .bottom-sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.25rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        background: var(--bottom-sheet-header-bg);
        border-radius: var(--bottom-sheet-border-radius) var(--bottom-sheet-border-radius) 0 0;
    }

    .bottom-sheet-header h5 {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 600;
    }

    .bottom-sheet-close {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #6c757d;
        cursor: pointer;
        padding: 0;
        line-height: 1;
    }

    .bottom-sheet-body {
        padding: 1rem 1.25rem;
        overflow-y: auto;
        flex: 1;
    }

    .bottom-sheet-body .list-group-item {
        border-left: none;
        border-right: none;
        padding: 0.75rem 0;
    }

    .bottom-sheet-body .list-group-item:first-child {
        border-top: none;
    }
}

@media (min-width: 992px) {
    .bottom-sheet-overlay,
    .bottom-sheet {
        display: none !important;
    }
}

/* PayTogether paid item highlight */
.paytogether-item {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    text-decoration: none;
    color: inherit;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    transition: background-color 0.2s, border-color 0.2s;
}

.paytogether-item:hover {
    background: #e9ecef;
    color: inherit;
    text-decoration: none;
}

.paytogether-item.paid {
    background: rgba(25, 135, 84, 0.1);
    border-color: rgba(25, 135, 84, 0.3);
}

.paytogether-item.paid:hover {
    background: rgba(25, 135, 84, 0.15);
}

.paytogether-item .item-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.paytogether-item .item-meta {
    font-size: 0.8rem;
    color: #6c757d;
}

.paytogether-item.paid .item-meta {
    color: #198754;
}

.paytogether-item .paid-badge {
    display: inline-block;
    background: #198754;
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-left: 0.5rem;
}

.paytogether-item.claimed {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
}

.paytogether-item.claimed:hover {
    background: rgba(255, 193, 7, 0.15);
}

.paytogether-item.claimed .item-meta {
    color: #856404;
}

.paytogether-item .claimed-badge {
    display: inline-block;
    background: #ffc107;
    color: #212529;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-left: 0.5rem;
}
