/* ChillPig Shopping List Styles */
/* Version: 2.3.13 */
/* Date: 2025-08-03 */
/* Enhanced: Improved scroll-safe mobile touch support, better scroll detection, optimized touch thresholds */

:root {
    --primary-color: #FF6B9D;
    --secondary-color: #E85A87;
    --accent-color: #4ECDC4;
    --danger-color: #dc3545;
    --chillpig-pink: #FF6B9D;
    --warning-color: #ffc107;
    --light-gray: #f8f9fa;
    --border-color: #dee2e6;
    --success-color: #4ECDC4;
    --pig-pink: #FFB6C1;
    --chill-blue: #87CEEB;
}

html, body {
    height: 100%;
    overflow-x: hidden;
    overscroll-behavior: none; /* Prevent overscroll on mobile */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

body {
    background: linear-gradient(135deg, #FFE4E1 0%, #E6F3FF 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 100vh; /* Ensure body takes full viewport height */
    
    /* Enhanced touch scrolling optimization */
    -webkit-overflow-scrolling: touch;
    
    /* Prevent horizontal overscroll which can interfere with vertical scrolling */
    overscroll-behavior-x: none;
    overscroll-behavior-y: auto;
    
    /* For WebKit browsers */
    -webkit-overscroll-behavior-x: none;
    -webkit-overscroll-behavior-y: auto;
}

.main-content {
    flex: 1 0 auto;
    
    /* Container optimizations for smooth scrolling */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: none;
    overscroll-behavior-y: auto;
}

.app-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(255, 107, 157, 0.3);
    position: relative;
}

.shopping-list-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem 2rem 1rem; /* Removed top padding to minimize whitespace */
    
    /* Enhanced scrolling optimization */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: none;
    overscroll-behavior-y: auto;
    
    /* Ensure no top spacing */
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Ensure list content is properly constrained */
.shopping-list-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Additional styles to minimize whitespace and ensure proper width constraint */
#shoppingListContent {
    max-width: 800px !important;
    margin: 0 auto !important;
    padding: 0 1rem 1rem 1rem !important; /* Remove top padding to eliminate gap from header */
}

/* Reduce spacing between header and list content */
.main-content {
    padding-top: 0 !important; /* Remove top padding completely */
}

/* Ensure no spacing between header and list content - consolidated above */

/* Aggressive spacing removal for shopping-list-container */
.shopping-list-container {
    padding-top: 0 !important;
    margin-top: 0 !important;
    border-top: none !important;
}

/* When viewing a list (all children hidden), collapse the container completely */
.shopping-list-container:has(#loadingState[style*="display: none"]):has(#welcomeSection[style*="display: none"]):has(#recentListsSection[style*="display: none"]) {
    padding: 0 !important;
    margin: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

/* Ensure the container itself doesn't add any visual spacing */
.shopping-list-container::before {
    display: none !important;
    content: none !important;
}

/* Hide welcome section by default and ensure it takes no space */
#welcomeSection {
    display: none;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    line-height: 0 !important;
}

/* When welcome section is shown, override the hidden state */
#welcomeSection[style*="display: block"],
#welcomeSection[style*="display: flex"] {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    line-height: normal !important;
    padding: 3rem 0 !important; /* Restore padding when shown */
}

/* Note: Removed global Bootstrap class overrides to prevent breaking other elements */

/* Hide loading state by default and ensure it takes no space */
#loadingState {
    display: none;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    line-height: 0 !important;
}

/* When loading state is shown, make it an overlay */
#loadingState[style*="display: block"],
#loadingState[style*="display: flex"] {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
    text-align: center !important;
    height: 100vh !important;
    overflow: visible !important;
    line-height: normal !important;
}

/* Hide recent lists section when not shown and ensure it takes no space */
#recentListsSection[style*="display: none"] {
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    line-height: 0 !important;
}

/* When recent lists section is shown, add proper top margin */
#recentListsSection[style*="display: block"] {
    margin-top: 1rem !important;
}

/* Ensure list title card has proper spacing and is constrained */
#listTitleCard {
    margin-top: 0 !important; /* Remove top margin completely to eliminate gap from header */
    margin-bottom: 2rem !important; /* Keep bottom margin for spacing */
    max-width: 800px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 1rem !important; /* Added padding all around */
}

/* Ensure all hidden direct children of shopping-list-container truly collapse */
.shopping-list-container > [style*="display: none"],
.shopping-list-container > [style*="display:none"] {
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    line-height: 0 !important;
    border: none !important;
}

/* When viewing a list, remove top spacing from shopping-list-container */
.shopping-list-container:has(> [style*="display: none"]:first-child) {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Ensure list title card has proper spacing when displayed */
#listTitleCard[style*="display: block"],
#listTitleCard:not([style*="display: none"]) {
    margin-top: 1.5rem !important; /* Add spacing from navigation */
    padding-top: 1rem !important; /* Add internal padding for the card content */
}

/* Ensure all action buttons and elements in list view are constrained */
.shopping-list-container .btn,
.shopping-list-container .d-flex,
.shopping-list-container .card {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* ChillPig Logo Styling */
.chillpig-logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pig-emoji {
    animation: wiggle 2s ease-in-out infinite;
    font-size: 1.8rem;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

/* Footer Styles */
.app-footer {
    flex-shrink: 0;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 0.75rem 0;
    font-size: 0.875rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    position: relative;
    z-index: 10;
    /* Prevent footer from being scrolled past */
    overscroll-behavior: none;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

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

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

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.status-connected {
    background: rgba(78, 205, 196, 0.2);
    color: var(--success-color);
    border: 1px solid rgba(78, 205, 196, 0.3);
}

.status-disconnected {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.status-connecting {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background-color: var(--success-color);
}

.status-dot.disconnected {
    background-color: #dc3545;
}

.status-dot.connecting {
    background-color: #ffc107;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.footer-info {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
}

.footer-logo-link {
    color: rgba(255, 255, 255, 0.7) !important;
    transition: color 0.3s ease;
    cursor: pointer;
}

.footer-logo-link:hover {
    color: white !important;
    text-decoration: none;
}

.footer-logo-link .pig-emoji {
    transition: transform 0.3s ease;
}

.footer-logo-link:hover .pig-emoji {
    transform: scale(1.1);
}

.footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: white;
    text-decoration: underline;
}

/* ChillPig Card Styling */
.add-item-form {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 8px 30px rgba(255, 107, 157, 0.2);
    margin-bottom: 2rem;
    border: 2px solid rgba(255, 107, 157, 0.1);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.category-section {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 30px rgba(255, 107, 157, 0.15);
    border: 2px solid rgba(255, 107, 157, 0.1);
    transition: all 0.3s ease;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.category-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(255, 107, 157, 0.2);
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-gray);
    gap: 0.75rem;
}

.category-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    line-height: 1;
}

.category-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex-grow: 1;
    line-height: 1.2;
}

.category-badge {
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    border: none;
    border-radius: 15px;
    padding: 0.3rem 0.8rem;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

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

.list-item.completed {
    opacity: 0.6;
}

.list-item.completed .item-text {
    text-decoration: line-through;
    color: #6c757d;
}

.item-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 1rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.item-content {
    flex-grow: 1;
}

.item-text {
    font-size: 1rem;
    color: #333;
    margin: 0;
}

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

/* Voice Commands FAB */
.voice-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fab-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.fab-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    background: linear-gradient(135deg, #0056b3, #004085);
}

.fab-button:active {
    transform: translateY(0) scale(0.95);
}

.fab-button.recording {
    background: linear-gradient(135deg, #dc3545, #c82333);
    animation: fab-pulse 1.5s infinite;
}

.fab-button.recording:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
}

@keyframes fab-pulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    }
}

.fab-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.fab-tooltip::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: rgba(0, 0, 0, 0.8);
}

.voice-fab:hover .fab-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Mobile adjustments for FAB */
@media (max-width: 768px) {
    .voice-fab {
        bottom: 15px;
        right: 15px;
    }
    
    .fab-button {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }
    
    .fab-tooltip {
        right: 65px;
        font-size: 11px;
        padding: 6px 10px;
    }
}

.btn-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-delete:hover {
    background-color: #ffcccc;
    transform: scale(1.1);
}

.btn-add {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 15px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

.btn-add:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

.form-control {
    border-radius: 15px;
    border: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 157, 0.25);
}

.search-suggestions, .item-suggestions, .quantity-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 15px 15px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.2);
}

.item-suggestions, .quantity-suggestions {
    min-width: 200px;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.suggestion-item:hover {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.1), rgba(78, 205, 196, 0.1));
}

/* Enhanced Suggestion Styling */
.suggestions-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.suggestions-header i {
    color: var(--primary-color);
}

.suggestion-category {
    font-size: 0.8rem;
    color: #6c757d;
    margin-left: auto;
    background: rgba(108, 117, 125, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.ai-loading-indicator {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.05), rgba(78, 205, 196, 0.05));
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-style: italic;
}

.ai-loading-indicator i {
    color: var(--primary-color);
}

.ai-suggestions-section {
    border-top: 2px solid #f0f0f0;
    margin-top: 0.5rem;
}

.ai-suggestions-section .ai-suggestions-header {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.1), rgba(78, 205, 196, 0.1));
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 0;
}

/* AI Suggestions Styling */
.ai-suggestions-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px 6px 0 0;
    margin: -1px -1px 0 -1px;
}

.ai-suggestion {
    border-left: 3px solid #667eea;
    background: linear-gradient(90deg, #f8f9ff 0%, #ffffff 100%);
}

.ai-suggestion:hover {
    background: linear-gradient(90deg, #e8f0ff 0%, #f8f9fa 100%);
}

.suggestion-name {
    font-weight: 500;
    color: #333;
}

.suggestion-confidence {
    font-size: 0.75rem;
    color: #667eea;
    font-weight: 600;
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}

.ai-suggestions-footer {
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 0 0 6px 6px;
    margin: 0 -1px -1px -1px;
    border-top: 1px solid #e9ecef;
}

/* OpenAI Magic Suggestions Styling */
.ai-suggestions-header .fa-magic {
    background: linear-gradient(45deg, #ff6b9d, #c44569, #f8b500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: magic-sparkle 2s ease-in-out infinite;
}

@keyframes magic-sparkle {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        filter: hue-rotate(0deg);
    }
    25% { 
        transform: scale(1.1) rotate(5deg);
        filter: hue-rotate(90deg);
    }
    50% { 
        transform: scale(1.05) rotate(-3deg);
        filter: hue-rotate(180deg);
    }
    75% { 
        transform: scale(1.1) rotate(3deg);
        filter: hue-rotate(270deg);
    }
}

/* Magic sparkle icon styling */
.suggestion-icon:contains("✨") {
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { 
        transform: scale(1);
        filter: brightness(1);
    }
    50% { 
        transform: scale(1.2);
        filter: brightness(1.3);
    }
}

/* AI Loading Spinner */
.ai-loading-container {
    padding: 20px;
    text-align: center;
    background: linear-gradient(90deg, #f8f9ff 0%, #ffffff 100%);
}

.ai-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.spinner-brain {
    font-size: 2rem;
    animation: brain-pulse 1.5s ease-in-out infinite;
}

.spinner-text {
    color: #667eea;
    font-weight: 500;
    font-size: 0.9rem;
    animation: text-fade 2s ease-in-out infinite;
}

@keyframes brain-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
}

@keyframes text-fade {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Store Suggestions Styling */
.store-suggestion {
    border-left: 3px solid #28a745;
    background: linear-gradient(90deg, #f8fff8 0%, #ffffff 100%);
}

.store-suggestion:hover {
    background: linear-gradient(90deg, #e8f5e8 0%, #f8f9fa 100%);
}

.store-suggestion .suggestion-icon {
    font-size: 1.1rem;
}

.suggestion-icon {
    margin-right: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Empty State Messages for Lists */
.empty-state-message {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px dashed #dee2e6;
    margin: 1rem 0;
}

.empty-state-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
    color: var(--primary-color);
}

.empty-state-message h5 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state-message p {
    color: #6c757d;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.empty-state-message .btn {
    margin-top: 0.5rem;
}

/* To-Do List Form Styling */
.todo-form {
    display: none;
}

.todo-form .form-control {
    font-size: 1rem;
    padding: 0.75rem 1rem;
}

.todo-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 157, 0.25);
}

.todo-form .btn {
    height: 100%;
    min-height: 48px;
}

/* Shopping List Form Styling */
.shopping-form {
    display: block;
}

.share-section {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 30px rgba(255, 107, 157, 0.15);
    border: 2px solid rgba(255, 107, 157, 0.1);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.share-url {
    background: linear-gradient(135deg, var(--light-gray), #f0f8ff);
    border-radius: 10px;
    padding: 0.75rem;
    font-family: monospace;
    word-break: break-all;
    margin: 1rem 0;
    border: 1px solid rgba(255, 107, 157, 0.2);
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    text-align: center;
    padding: 0;
    margin: 0;
}

.spinner-border {
    color: var(--primary-color);
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

/* Loading overlay text styling */
.loading div {
    margin-top: 1rem;
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* User Dropdown Styles - Enhanced Admin-style */
.user-dropdown-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.25);
    color: white;
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.user-dropdown-btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.3);
    color: white;
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

.user-dropdown-menu {
    min-width: 220px;
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    margin-top: 0.75rem;
    padding: 0.5rem 0;
    background: white;
}

.user-dropdown-menu .dropdown-item {
    padding: 0.875rem 1.25rem;
    border-radius: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.user-dropdown-menu .dropdown-item:hover {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.08), rgba(78, 205, 196, 0.08));
    color: var(--primary-color);
    border-left-color: rgba(255, 107, 157, 0.3);
    padding-left: calc(1.25rem - 3px);
}

.user-dropdown-menu .dropdown-item.active {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.12), rgba(78, 205, 196, 0.12));
    color: var(--primary-color);
    font-weight: 600;
    border-left: 3px solid var(--chillpig-pink);
    padding-left: calc(1.25rem - 3px);
}

.user-dropdown-menu .dropdown-item.active i {
    color: var(--chillpig-pink);
}

.user-dropdown-menu .dropdown-item i {
    width: 18px;
    text-align: center;
    margin-right: 0.75rem;
    font-size: 0.9rem;
}

.user-dropdown-menu .dropdown-divider {
    margin: 0.5rem 0;
    border-color: #e9ecef;
}

/* Custom pink text color for headings */
.text-pink {
    color: var(--chillpig-pink) !important;
    text-align: center !important;
}

/* List Switcher Styles - Enhanced Admin-style */
.list-switcher {
    position: relative;
}

.list-switcher-btn {
    background: white;
    border: 2px solid #e9ecef;
    color: #2c3e50;
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.list-switcher-btn:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #2c3e50;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.list-switcher-dropdown {
    min-width: 320px;
    max-height: 400px;
    overflow-y: auto;
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    background: white;
    padding: 0.5rem 0;
}

.list-switcher-dropdown .dropdown-item {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 0;
    transition: all 0.2s ease;
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.9rem;
}

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

.list-switcher-dropdown .dropdown-item:hover {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.08), rgba(78, 205, 196, 0.08));
    color: var(--primary-color);
}

/* Editable Elements */
.editable-title, .editable-item-name, .editable-quantity {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.editable-title:hover, .editable-item-name:hover, .editable-quantity:hover {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.1), rgba(78, 205, 196, 0.1));
    color: var(--primary-color);
}

.editable-title:hover::after, .editable-item-name:hover::after, .editable-quantity:hover::after {
    content: " 🐷";
    font-size: 0.8em;
    opacity: 0.7;
}

.item-name-input, .quantity-input {
    border: 2px solid var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 157, 0.25) !important;
    border-radius: 8px !important;
}

#listTitleInput {
    font-size: 1.75rem;
    font-weight: 600;
    border: 2px solid var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 157, 0.25) !important;
    border-radius: 15px !important;
}

/* ENHANCED: Equal Height Cards CSS with Scroll-Safe Mobile Touch Support */

/* Reset the main container to normal flow */
#recentListsContainer {
    display: block !important;
}

/* Grid wrapper for card sections - Created by JavaScript */
.cards-grid-wrapper {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    align-items: stretch; /* Equal height cards */
    margin-bottom: 2rem;
    
    /* ENHANCED: Container-level scroll optimization */
    touch-action: pan-y; /* Allow only vertical scrolling within the grid */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling behavior */
    scroll-behavior: smooth; /* Prevent momentum scrolling from interfering */
}

/* ENHANCED: Recent List Cards with Scroll-Safe Touch and Equal Heights */
.recent-list-card {
    background: white;
    border: 2px solid rgba(255, 107, 157, 0.2);
    border-radius: 15px;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    
    /* Equal height support */
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
    
    /* ENHANCED: Scroll-safe mobile touch support */
    touch-action: manipulation; /* Precise touch action control */
    user-select: none; /* Prevent text selection during touch */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    
    /* Disable callouts and highlights that can interfere */
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    
    /* Ensure proper stacking for touch events */
    position: relative;
    z-index: 1;
    
    /* Smooth transitions for visual feedback */
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Remove hover effects from cards since they're no longer clickable */

/* Re-enable pointer events for buttons within cards */
.recent-list-card .btn {
    pointer-events: auto;
    touch-action: manipulation;
}

.recent-list-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    flex-grow: 1; /* Allow title to expand and push meta to bottom */
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.recent-list-title .title-left {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0; /* Allow text to wrap if needed */
    gap: 0.5rem;
}

.recent-list-title .title-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.recent-list-title .list-type-text {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.recent-list-title .list-name {
    flex: 1;
    min-width: 0; /* Allow text to wrap if needed */
}

.recent-list-title .list-name.clickable {
    cursor: pointer;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

.recent-list-title .list-name.clickable:hover {
    color: #e55a8a;
    text-decoration: underline;
}

.recent-list-title .item-count-badge {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.recent-list-store {
    margin-bottom: 0.5rem;
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.recent-list-store .store-name {
    font-weight: 500;
    color: var(--primary-color);
}

.recent-list-meta {
    font-size: 0.875rem;
    color: #6c757d;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto; /* Push meta to bottom of card */
}

.recent-list-date {
    font-size: 0.8rem;
}

.recent-list-items {
    color: var(--primary-color);
    font-weight: 500;
}

/* Card actions section */
.card-actions {
    margin-top: auto;
    padding-top: 1rem;
    padding-bottom: 1rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* Card footer with creation date */
.card-footer {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* Open list button styling */
.btn-open-list {
    background: linear-gradient(135deg, var(--primary-color), #ff6b9d);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(255, 107, 157, 0.2);
    min-width: 120px;
}

.btn-open-list:hover {
    background: linear-gradient(135deg, #e55a8a, #ff6b9d);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 107, 157, 0.3);
    color: white;
}

.btn-open-list:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(255, 107, 157, 0.2);
}

.btn-open-list:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.3);
}

/* Delete list button styling */
.btn-delete-list {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-list:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.btn-delete-list:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.btn-delete-list:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.3);
}

/* Inline delete button styling */
.btn-delete-list-inline {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.btn-delete-list-inline:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

.btn-delete-list-inline:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(220, 53, 69, 0.2);
}

.btn-delete-list-inline:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.3);
}

/* Enhanced styling for shared lists with scroll-safe touch */
.shared-list-card {
    border-color: rgba(78, 205, 196, 0.3) !important;
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.02), rgba(255, 255, 255, 1));
}

/* Remove hover effects from shared cards since they're no longer clickable */

.shared-badge {
    font-size: 0.7rem !important;
    padding: 0.2rem 0.5rem !important;
    border-radius: 10px !important;
    pointer-events: none; /* Prevent interference with card touch events */
}

.shared-list-indicator {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(78, 205, 196, 0.2);
    pointer-events: none; /* Prevent interference with card touch events */
}

/* Enhanced section headings for lists */
#recentListsContainer h5 {
    font-weight: 600;
    color: var(--primary-color) !important;
    border-bottom: 2px solid rgba(255, 107, 157, 0.2);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem !important;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-out {
    animation: slideOut 0.3s ease-out forwards;
}

@keyframes slideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-100%); }
}

/* ChillPig Welcome Section - FIXED CENTERING */
.chillpig-welcome {
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.chillpig-welcome h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    width: 100%;
    display: block;
    
    /* Gradient text with better browser support */
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    background-size: 100%;
    background-repeat: repeat;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    -moz-background-clip: text;
    -moz-text-fill-color: transparent;
    background-clip: text;
    
    /* Fallback for browsers that don't support gradient text */
    color: var(--primary-color);
}

/* Ensure wave emoji displays properly in welcome - NO GRADIENT */
.chillpig-welcome h2 .wave-emoji {
    display: inline;
    -webkit-text-fill-color: initial !important;
    -moz-text-fill-color: initial !important;
    background: none !important;
    background-clip: initial !important;
    -webkit-background-clip: initial !important;
    -moz-background-clip: initial !important;
    margin-right: 0.25rem;
    color: initial !important;
}

.chillpig-tagline {
    font-size: 1.1rem;
    color: #666;
    font-style: italic;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

/* Button Styling */
.btn-outline-light {
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-radius: 15px;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.btn-outline-secondary, .btn-outline-danger {
    border-radius: 15px;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover, .btn-outline-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* List Type Toggle Styling */
.list-type-toggle {
    display: flex;
    background: rgba(255, 107, 157, 0.05);
    border: 2px solid rgba(255, 107, 157, 0.2);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.toggle-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: 500;
    color: #6c757d;
    background: transparent;
    border: none;
    user-select: none;
}

.toggle-option:hover {
    background: rgba(255, 107, 157, 0.1);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.toggle-option.active {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 107, 157, 0.3);
}

.toggle-option.active:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
}

/* Center the Clear All Lists button */
#recentListsSection .text-center.mt-4 .row.g-2 {
    justify-content: center;
    align-items: center;
}

#recentListsSection .text-center.mt-4 .row.g-2 .col-md-6 {
    flex: 0 0 auto;
    max-width: 300px;
}

/* Modal Styling - Enhanced for Better Contrast */
.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    background: #ffffff;
}

.modal-header {
    background: linear-gradient(135deg, #2C3E50 0%, #34495E 100%);
    color: #ffffff;
    border-radius: 20px 20px 0 0;
    border-bottom: 3px solid var(--primary-color);
    padding: 1.5rem 2rem;
}

.modal-header .modal-title {
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.modal-body {
    background: #ffffff;
    color: #2C3E50;
    padding: 2rem;
    line-height: 1.6;
}

/* Modal footer removed */

/* Custom close button styling for modals only - not for Bootstrap alerts */
.modal .btn-close,
.modal-header .btn-close,
.modal-footer .btn-close {
    background: linear-gradient(135deg, var(--primary-color) 0%, #E85A87 100%);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    opacity: 1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3), 0 2px 4px rgba(255, 107, 157, 0.2);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.modal .btn-close::before,
.modal-header .btn-close::before,
.modal-footer .btn-close::before {
    content: "×";
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.modal .btn-close::after,
.modal-header .btn-close::after,
.modal-footer .btn-close::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #E85A87 100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
}

.modal .btn-close:hover,
.modal-header .btn-close:hover,
.modal-footer .btn-close:hover {
    background: transparent;
    border-color: var(--primary-color);
    color: #ffffff;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.4), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal .btn-close:hover::after,
.modal-header .btn-close:hover::after,
.modal-footer .btn-close:hover::after {
    opacity: 1;
}

.modal .btn-close:hover::before,
.modal-header .btn-close:hover::before,
.modal-footer .btn-close:hover::before {
    color: #ffffff;
    transform: rotate(90deg);
}

.modal .btn-close:active,
.modal-header .btn-close:active,
.modal-footer .btn-close:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

.modal .btn-close:focus,
.modal-header .btn-close:focus,
.modal-footer .btn-close:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.3), 0 8px 25px rgba(255, 107, 157, 0.4);
}

/* Ensure Bootstrap alert close buttons use standard styling */
.alert .btn-close {
    background: none;
    border: none;
    border-radius: 0.375rem;
    width: 1em;
    height: 1em;
    opacity: 0.5;
    transition: opacity 0.15s ease-in-out;
    color: inherit;
    font-weight: normal;
    box-shadow: none;
    font-size: 1rem;
    display: inline-block;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 0.75rem;
    top: 0.75rem;
    overflow: visible;
    padding: 0.25em 0.25em;
    margin: 0;
}

.alert .btn-close::before {
    content: "×";
    position: relative;
    z-index: 2;
    transition: none;
    font-size: 1.25em;
    line-height: 1;
}

.alert .btn-close::after {
    display: none;
}

.alert .btn-close:hover {
    background: none;
    border: none;
    color: inherit;
    transform: none;
    box-shadow: none;
    opacity: 0.75;
}

.alert .btn-close:hover::after {
    display: none;
}

.alert .btn-close:hover::before {
    color: inherit;
    transform: none;
}

.alert .btn-close:active {
    transform: none;
    box-shadow: none;
}

.alert .btn-close:focus {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Modal footer removed - button styles no longer needed */

/* Modal Form Elements Contrast */
.modal-body .form-label {
    color: #2C3E50;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.modal-body .form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    background-color: #ffffff !important;
    color: #212529 !important;
}

.modal-body .form-control::placeholder {
    color: #6c757d !important;
    opacity: 1;
}

.modal-body .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 157, 0.25);
    background-color: #ffffff !important;
    color: #212529 !important;
}

.modal-body .form-control:focus::placeholder {
    color: #6c757d !important;
    opacity: 1;
}

.modal-body .form-text {
    color: #6c757d;
    font-size: 0.875rem;
}

/* Create List Modal Specific Styles */
#createListModal .form-control {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 2px solid #e9ecef !important;
}

#createListModal .form-control::placeholder {
    color: #6c757d !important;
    opacity: 1;
}

#createListModal .form-control:focus {
    background-color: #ffffff !important;
    color: #212529 !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 157, 0.25) !important;
}

#createListModal .form-control:focus::placeholder {
    color: #6c757d !important;
    opacity: 1;
}

#createListModal .form-label {
    color: #2C3E50 !important;
    font-weight: 600;
}

#createListModal .form-text {
    color: #6c757d !important;
}

.modal-body .alert {
    border-radius: 10px;
    border: none;
    font-weight: 500;
}

.modal-body .alert-info {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.1), rgba(78, 205, 196, 0.05));
    color: #0c5460;
    border-left: 4px solid var(--accent-color);
}

.modal-body .alert-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.05));
    color: #856404;
    border-left: 4px solid #ffc107;
}

.modal-body .alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .modal-content {
        border: 3px solid #000000;
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8);
    }
    
    .modal-header {
        background: #000000;
        color: #ffffff;
        border-bottom: 4px solid var(--primary-color);
    }
    
    .modal-body {
        background: #ffffff;
        color: #000000;
    }
    
    /* Modal footer removed */
    
    .btn-close {
        background: #000000;
        border: 3px solid #ffffff;
        color: #ffffff;
    }
    
    .btn-close:hover {
        background: #ffffff;
        color: #000000;
        border-color: #000000;
    }
    
    /* Modal footer removed - button styles no longer needed */
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .modal-content,
    .btn-close {
        transition: none;
    }
    
    .btn-close:hover {
        transform: none;
    }
}

/* Focus Indicators for Better Accessibility */
.modal-content:focus-within {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.modal-body .form-control:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 1px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .modal-body {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    /* Modal footer removed */
    
    .modal-body .form-control {
        background: #2d2d2d;
        border-color: #444444;
        color: #ffffff;
    }
    
    .modal-body .form-control:focus {
        background: #2d2d2d;
        border-color: var(--primary-color);
        color: #ffffff;
    }
    
    .modal-body .form-label {
        color: #ffffff;
    }
    
    .modal-body .form-text {
        color: #cccccc;
    }
    
    /* Override dark mode for create list modal to ensure good contrast */
    #createListModal .modal-content {
        background: #ffffff !important;
        color: #212529 !important;
    }
    
    #createListModal .modal-body {
        background: #ffffff !important;
        color: #212529 !important;
    }
    
    #createListModal .form-control {
        background: #ffffff !important;
        border-color: #e9ecef !important;
        color: #212529 !important;
    }
    
    #createListModal .form-control::placeholder {
        color: #6c757d !important;
        opacity: 1;
    }
    
    #createListModal .form-control:focus {
        background: #ffffff !important;
        border-color: var(--primary-color) !important;
        color: #212529 !important;
    }
    
    #createListModal .form-control:focus::placeholder {
        color: #6c757d !important;
        opacity: 1;
    }
    
    #createListModal .form-label {
        color: #2C3E50 !important;
    }
    
    #createListModal .form-text {
        color: #6c757d !important;
    }
}

/* Additional ChillPig Form Styling */
#quantityTypeSuggestions {
    border-radius: 0 0 15px 15px;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.2);
}

#quantity, #quantityType {
    text-align: center;
    font-weight: 600;
}

#quantityType::placeholder {
    font-style: italic;
    opacity: 0.7;
}

.add-item-form small.text-muted i {
    color: var(--primary-color);
    opacity: 0.7;
}

/* Focus states for better UX */
#quantity:focus,
#quantityType:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 157, 0.25);
}

/* Delete List Section - Proper spacing for footer clearance and width constraint */
#deleteListSection {
    text-align: center;
    margin-top: 3rem !important; /* Increased top margin */
    margin-bottom: 6rem !important; /* Ensure adequate footer spacing */
    padding: 2rem 1rem !important; /* Added top and bottom padding */
    max-width: 800px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Shopping list container - ensure proper bottom spacing */
.shopping-list-container {
    padding-bottom: 6rem !important; /* Increased from 2rem to ensure footer clearance */
}

/* Main content - ensure it doesn't compress */
.main-content {
    flex: 1 0 auto;
    min-height: calc(100vh - 120px); /* Ensure minimum height minus footer */
}

/* ENHANCED: Mobile Responsive with Improved Scroll-Safe Touch Support */
@media (max-width: 768px) {
    /* Enhanced mobile overscroll prevention and touch optimization */
    html, body {
        overscroll-behavior: none;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y; /* Only allow vertical scrolling */
    }
    
    .main-content {
        overscroll-behavior-y: contain;
    }
    
    /* Mobile Grid Layout - Single Column */
    .cards-grid-wrapper {
        grid-template-columns: 1fr !important; /* Single column on mobile */
        gap: 1rem;
        /* Maintain scroll-safe touch handling */
        touch-action: pan-y;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .footer-left,
    .footer-right {
        justify-content: center;
    }

    .footer-right {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .chillpig-welcome h2 {
        font-size: 2rem;
    }

    .pig-emoji {
        font-size: 1.5rem;
    }

    .shopping-list-container {
        padding: 0 0.5rem 0.5rem 0.5rem; /* Remove top padding on mobile too */
        /* Prevent overscroll in container */
        overscroll-behavior: none;
    }

    .add-item-form,
    .category-section,
    .share-section {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 15px;
    }

    .category-header {
        display: flex;
        align-items: center;
        flex-direction: row;
        gap: 0.5rem;
    }

    .category-icon {
        font-size: 1.25rem;
        flex-shrink: 0;
    }

    .category-title {
        font-size: 1.1rem;
        flex-grow: 1;
        white-space: nowrap;
    }

    .category-badge {
        font-size: 0.8rem;
        flex-shrink: 0;
    }

    .item-actions {
        margin-left: 0.5rem;
    }

    #listTitleCard > .d-flex {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    #listTitleCard .d-flex.gap-2 {
        flex-direction: row !important;
        justify-content: center;
        gap: 0.75rem !important;
    }

    #listTitleCard h2 {
        font-size: 1.5rem;
    }
    
    /* Shared List Indicator */
    .shared-indicator {
        font-size: 0.75rem;
        font-weight: 600;
        padding: 0.25rem 0.5rem;
        border-radius: 12px;
        background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
        border: none;
        box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
        animation: pulse 2s infinite;
    }
    
    .shared-indicator i {
        font-size: 0.7rem;
    }
    
    @keyframes pulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.05); }
        100% { transform: scale(1); }
    }
    
    /* Dark mode support for shared indicator */
    @media (prefers-color-scheme: dark) {
        .shared-indicator {
            background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%) !important;
            color: #ffffff !important;
        }
    }

    .app-header .d-flex {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .list-switcher-dropdown {
        min-width: 280px;
    }

    .item-suggestions {
        min-width: 180px;
    }

    .quantity-suggestions {
        min-width: 100px;
    }

    #addItemForm .row.g-3 {
        margin-bottom: 0.5rem;
    }
    
    #addItemForm .col-md-2:first-child {
        order: 1;
    }
    
    #addItemForm .col-md-3 {
        order: 2;
    }
    
    #addItemForm .col-md-5 {
        order: 3;
    }
    
    #addItemForm .col-md-2:last-child {
        order: 4;
        margin-top: 0.5rem;
    }
    
    #addItemForm .col-md-2:last-child .btn {
        width: 100%;
    }

    /* ENHANCED: Mobile card styling */
    .recent-list-card {
        padding: 1.25rem !important;
        border-radius: 12px !important;
        min-height: 120px !important;
    }
    
    /* Mobile button styling */
    .btn-open-list {
        padding: 0.6rem 1.2rem !important;
        font-size: 0.9rem !important;
        min-width: 140px !important;
    }

    /* Ensure badges and indicators don't interfere with touch */
    .shared-badge,
    .shared-list-indicator,
    .recent-list-date,
    .recent-list-items {
        pointer-events: none;
        touch-action: none;
    }
    
    /* Prevent accidental zoom on form inputs */
    input, select, textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Better shared list indicators on mobile */
    .shared-list-indicator {
        margin-top: 0.75rem;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(78, 205, 196, 0.2);
    }

    /* Improved badge spacing */
    .shared-badge {
        margin-left: 0.5rem !important;
        font-size: 0.7rem !important;
        padding: 0.25rem 0.5rem !important;
    }

    /* Better section headers on mobile */
    #recentListsContainer h5 {
        font-size: 1rem !important;
        margin-bottom: 0.75rem !important;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid rgba(255, 107, 157, 0.2);
    }

    /* Enhanced list meta information layout with equal height support */
    .recent-list-meta {
        flex-direction: column !important;
        gap: 0.25rem;
        align-items: flex-start !important;
        margin-top: auto; /* Keep pushing to bottom even on mobile */
    }

    .recent-list-date {
        font-size: 0.75rem !important;
        opacity: 0.8;
    }

    .recent-list-items {
        font-size: 0.85rem !important;
        font-weight: 600 !important;
    }

    /* Improved title truncation on mobile with flex support */
    .recent-list-title {
        line-height: 1.3 !important;
        margin-bottom: 0.75rem !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-grow: 1 !important; /* Maintain flex behavior */
    }

    /* Center Clear All Lists button on mobile */
    #recentListsSection .text-center.mt-4 .row.g-2 .col-md-6 {
        max-width: 100%;
    }

    /* Extra mobile spacing adjustments for footer clearance */
    #deleteListSection {
        margin-bottom: 8rem !important; /* Extra space on mobile */
        padding-bottom: 3rem;
    }
}

/* Enhanced mobile optimization for very small devices */
@media (max-width: 576px) {
    #addItemForm .row .col-md-2,
    #addItemForm .row .col-md-3,
    #addItemForm .row .col-md-5 {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    #addItemForm .row .col-md-2:last-child {
        margin-bottom: 0;
    }

    /* Extra small screens - maintain equal heights and enhanced scroll-safe touch */
    .recent-list-card {
        padding: 1.5rem !important;
        min-height: 140px !important;
        
        /* Enhanced scroll-safe touch handling for very small screens */
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: transparent !important;
    }
    
    /* Slightly smaller scale change to reduce visual jarring on small screens */
    .recent-list-card.touching {
        transform: scale(0.99);
    }

    .shopping-list-container {
        padding: 0 0.25rem 0.25rem 0.25rem; /* Remove top padding on extra small screens too */
    }

    /* Improved no-lists message on small screens */
    #recentListsContainer .text-center.text-muted.py-4 {
        padding: 2rem 1rem !important;
    }

    #recentListsContainer .text-center.text-muted.py-4 i {
        font-size: 2.5rem !important;
        margin-bottom: 1rem !important;
    }
}

/* ENHANCED: Accessibility and Long-Press Features */

/* Accessibility improvements for long-press */
@media (prefers-reduced-motion: reduce) {
    .long-press-progress {
        animation: none !important;
        /* Show a static progress indicator instead */
        background: conic-gradient(
            white 0deg 180deg,
            rgba(255, 255, 255, 0.3) 180deg 360deg
        );
        border: none;
    }
    
    .recent-list-card.long-press-active {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .long-press-indicator {
        background: rgba(0, 0, 0, 0.9);
        border: 2px solid white;
    }
    
    .long-press-progress {
        border-color: white;
        border-top-color: yellow;
    }
}

/* Focus states for keyboard navigation */
.recent-list-card:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.recent-list-card:focus .long-press-indicator {
    display: none; /* Don't show long-press indicator on keyboard focus */
}

/* Info toast styling for the tip */
.alert-info {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.1), rgba(255, 255, 255, 0.9));
    border-color: var(--accent-color);
    color: #0c5460;
}

/* Simplified Shared List Welcome Alert - Clean & Minimal */
.shared-list-welcome-simple {
    position: fixed !important;
    top: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: white !important;
    border: 2px solid #e9ecef !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
    z-index: 1050 !important;
    max-width: 400px !important;
    width: 90% !important;
    animation: slideDown 0.3s ease-out !important;
    margin: 0 !important;
    padding: 0 !important;
}

.shared-welcome-content-simple {
    display: flex !important;
    align-items: center !important;
    padding: 1rem !important;
    position: relative !important;
    margin: 0 !important;
}

.shared-welcome-icon-simple {
    width: 40px !important;
    height: 40px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 0.75rem !important;
    flex-shrink: 0 !important;
}

.shared-welcome-icon-simple .pig-emoji {
    font-size: 1.2rem !important;
}

.shared-welcome-text-simple {
    flex: 1 !important;
    padding-right: 2rem !important;
    margin: 0 !important;
}

.shared-welcome-title-simple {
    color: #2c3e50 !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    margin: 0 0 0.25rem 0 !important;
    line-height: 1.3 !important;
}

.shared-welcome-subtitle-simple {
    color: #6c757d !important;
    font-weight: 500 !important;
    font-size: 0.9rem !important;
    margin: 0 !important;
    line-height: 1.4 !important;
}

.shared-welcome-subtitle-simple strong {
    color: #667eea !important;
    font-weight: 600 !important;
}

.btn-close-simple {
    position: absolute !important;
    top: 0.5rem !important;
    right: 0.5rem !important;
    background: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    border-radius: 50% !important;
    width: 24px !important;
    height: 24px !important;
    opacity: 1 !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
    cursor: pointer !important;
}

.btn-close-simple i {
    font-size: 0.7rem !important;
    color: #6c757d !important;
}

.btn-close-simple:hover {
    background: #e9ecef !important;
    transform: scale(1.1) !important;
}

.btn-close-simple:hover i {
    color: #495057 !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Mobile responsiveness for simplified modal */
@media (max-width: 768px) {
    .shared-list-welcome-simple {
        top: 10px !important;
        left: 10px !important;
        right: 10px !important;
        transform: none !important;
        max-width: none !important;
        width: auto !important;
    }
    
    .shared-welcome-content-simple {
        padding: 0.75rem !important;
    }
    
    .shared-welcome-icon-simple {
        width: 35px !important;
        height: 35px !important;
        margin-right: 0.5rem !important;
    }
    
    .shared-welcome-title-simple {
        font-size: 0.9rem !important;
    }
    
    .shared-welcome-subtitle-simple {
        font-size: 0.8rem !important;
    }
}

/* Enhanced Shared List Welcome Alert - Complete UX Revamp */
.shared-list-welcome {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    color: #2c3e50;
    padding: 0;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: none;
}

.shared-list-welcome::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Header Section */
.shared-welcome-header {
    display: flex;
    align-items: flex-start;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    position: relative;
}

.shared-welcome-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.shared-welcome-icon .pig-emoji {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.shared-welcome-content {
    flex: 1;
    padding-right: 2rem;
}

.shared-welcome-title {
    color: #2c3e50;
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.shared-welcome-subtitle {
    color: #6c757d;
    font-weight: 500;
    font-size: 1rem;
    margin: 0;
    line-height: 1.4;
}

.shared-welcome-subtitle strong {
    color: #667eea;
    font-weight: 700;
}

/* Close Button - Top Right */
.shared-list-welcome .btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    opacity: 1;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.shared-list-welcome .btn-close i {
    font-size: 0.8rem;
    color: #6c757d;
}

.shared-list-welcome .btn-close:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    transform: scale(1.1);
}

.shared-list-welcome .btn-close:hover i {
    color: #495057;
}

.shared-list-welcome .btn-close:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Body Section */
.shared-welcome-body {
    padding: 0 1.5rem 1.5rem 1.5rem;
}

.shared-welcome-features {
    margin-bottom: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.feature-item:last-child {
    margin-bottom: 0;
}

.feature-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.feature-text {
    flex: 1;
}

.feature-text strong {
    display: block;
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.feature-text span {
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Actions Section */
.shared-welcome-actions {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.shared-welcome-actions .btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.shared-welcome-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    color: white;
}

.shared-welcome-actions .btn:active {
    transform: translateY(0);
}

/* Animation */
.shared-list-welcome {
    animation: slideInFromTop 0.6s ease-out;
    opacity: 1;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .shared-list-welcome {
        background: #2d3748;
        border-color: #4a5568;
        color: #ffffff;
    }
    
    .shared-welcome-title {
        color: #ffffff;
    }
    
    .shared-welcome-subtitle {
        color: #a0aec0;
    }
    
    .shared-welcome-subtitle strong {
        color: #667eea;
    }
    
    .feature-item {
        background: #4a5568;
    }
    
    .feature-item:hover {
        background: #2d3748;
    }
    
    .feature-text strong {
        color: #ffffff;
    }
    
    .feature-text span {
        color: #a0aec0;
    }
    
    .feature-icon {
        background: #2d3748;
    }
    
    .shared-welcome-actions {
        border-top-color: #4a5568;
    }
    
    .shared-list-welcome .btn-close {
        background: #4a5568;
        border-color: #2d3748;
    }
    
    .shared-list-welcome .btn-close i {
        color: #a0aec0;
    }
    
    .shared-list-welcome .btn-close:hover {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .shared-list-welcome .btn-close:hover i {
        color: #ffffff;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .shared-welcome-header {
        padding: 1rem;
    }
    
    .shared-welcome-body {
        padding: 0 1rem 1rem 1rem;
    }
    
    .shared-welcome-icon {
        width: 50px;
        height: 50px;
        margin-right: 0.75rem;
    }
    
    .shared-welcome-icon .pig-emoji {
        font-size: 1.5rem;
    }
    
    .shared-welcome-title {
        font-size: 1.1rem;
    }
    
    .shared-welcome-subtitle {
        font-size: 0.9rem;
    }
}

/* Enhanced Share Modal - Modern Design with Better Contrast */
#shareModal .modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

#shareModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    padding: 1.5rem 2rem;
    position: relative;
}

#shareModal .modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

#shareModal .modal-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.25rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

#shareModal .btn-close {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    opacity: 1;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

#shareModal .btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

#shareModal .modal-body {
    background: #ffffff;
    color: #2c3e50;
    padding: 2rem;
    line-height: 1.6;
}

#shareModal .modal-body h6 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

#shareModal .share-icon-container {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

#shareModal .btn-add {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

#shareModal .btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    color: white;
}

#shareModal .btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

#shareModal .btn-outline-primary:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-1px);
}

#shareModal .btn-outline-success {
    border: 2px solid #28a745;
    color: #28a745;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

#shareModal .btn-outline-success:hover {
    background: #28a745;
    border-color: #28a745;
    color: white;
    transform: translateY(-1px);
}

#shareModal .btn-outline-secondary {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    color: #495057;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

#shareModal .btn-outline-secondary:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    color: #495057;
    transform: translateY(-1px);
}

#shareModal .share-url {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    color: #495057;
    word-break: break-all;
    line-height: 1.4;
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: all;
}

#shareModal .share-url:hover {
    border-color: #667eea;
    background: #f0f2ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

#shareModal .share-url:focus {
    outline: none;
    border-color: #667eea;
    background: #f0f2ff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

#shareModal .text-muted {
    color: #6c757d !important;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

#shareModal .alert-info {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.05));
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    color: #2c3e50;
    font-weight: 500;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

#shareModal .alert-info i {
    color: #667eea;
    margin-right: 0.5rem;
}

#shareModal .alert-info strong {
    color: #2c3e50;
    font-weight: 700;
}

/* Dark mode support for share modal */
@media (prefers-color-scheme: dark) {
    #shareModal .modal-body {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    #shareModal .modal-body h6 {
        color: #ffffff;
    }
    
    #shareModal .share-icon-container {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    }
    
    #shareModal .share-url {
        background: #2d2d2d;
        border-color: #444444;
        color: #ffffff;
    }
    
    #shareModal .share-url:hover {
        border-color: #667eea;
        background: #3a3a3a;
    }
    
    #shareModal .share-url:focus {
        border-color: #667eea;
        background: #3a3a3a;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
    }
    
    #shareModal .text-muted {
        color: #adb5bd !important;
    }
    
    #shareModal .alert-info {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.1));
        border-color: rgba(102, 126, 234, 0.3);
        color: #ffffff;
    }
    
    #shareModal .alert-info strong {
        color: #ffffff;
    }
    
    #shareModal .btn-outline-secondary {
        background: #2d2d2d;
        border-color: #444444;
        color: #ffffff;
    }
    
    #shareModal .btn-outline-secondary:hover {
        background: #444444;
        border-color: #555555;
        color: #ffffff;
    }
}

/* Inline Create List Form Styles */
.advanced-create-form {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.advanced-create-form .form-label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.advanced-create-form .form-text {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 5px;
}

.advanced-create-form .btn-group .btn {
    border-radius: 8px;
}

.advanced-create-form .btn-group .btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.advanced-create-form .btn-group .btn:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Store Search Field Styles */
.store-search-container {
    position: relative;
}

.store-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
}

.store-suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.store-suggestion-item:hover {
    background-color: var(--light-gray);
}

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

.store-suggestion-item.selected {
    background-color: var(--primary-color);
    color: white;
}

.store-suggestion-item .store-icon {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.store-suggestion-item.selected .store-icon {
    color: white;
}

.store-suggestion-item .store-name {
    font-weight: 500;
}

.store-suggestion-item .store-category {
    font-size: 0.85rem;
    color: #666;
    margin-left: auto;
}

.store-suggestion-item.selected .store-category {
    color: rgba(255, 255, 255, 0.8);
}

/* No results message */
.store-suggestions .no-results {
    padding: 15px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .create-list-form {
        padding: 10px;
    }
    
    .create-list-container {
        max-height: 95vh;
    }
    
    .create-list-body {
        padding: 20px;
    }
    
    .create-list-actions {
        flex-direction: column;
    }
    
    .create-list-actions .btn {
        width: 100%;
    }
}

/* Desktop Navigation - Enhanced Admin-style */
.app-header .nav-link {
    padding: 14px 24px !important;
    margin: 0 6px;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.app-header .nav-link.active {
    background-color: rgba(255, 255, 255, 0.25) !important;
    color: white !important;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.app-header .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.app-header .nav-link.active:hover {
    background-color: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Glowing effect for active My Lists link in header */
.app-header .nav-link.active {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4), 
                0 0 30px rgba(255, 255, 255, 0.2),
                0 0 45px rgba(255, 255, 255, 0.1);
    animation: glow-pulse 2s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
    0% {
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.4), 
                    0 0 30px rgba(255, 255, 255, 0.2),
                    0 0 45px rgba(255, 255, 255, 0.1);
    }
    100% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.6), 
                    0 0 40px rgba(255, 255, 255, 0.3),
                    0 0 60px rgba(255, 255, 255, 0.2);
    }
}

/* User Dropdown Button Alignment - Enhanced Admin-style */
.user-dropdown-btn {
    padding: 14px 24px !important;
    margin: 0 6px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    background-color: rgba(255, 255, 255, 0.15);
    color: white !important;
    font-weight: 600;
    display: flex;
    align-items: center;
    height: auto;
    min-height: 48px; /* Match nav-link height */
    transition: all 0.3s ease;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-dropdown-btn:hover {
    background-color: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.4);
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.user-dropdown-btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.4);
    color: white !important;
    transform: translateY(-1px);
}

/* Mobile Menu Toggle Button Alignment */
.btn-outline-light {
    padding: 12px 16px !important;
    margin: 0 4px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
    color: white !important;
    font-weight: 600;
    min-height: 48px; /* Match nav-link height */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.4);
    color: white !important;
    transform: none; /* Prevent any transform that might cause movement */
}

.btn-outline-light:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    background-color: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.4);
    color: white !important;
    transform: none; /* Prevent any transform that might cause movement */
}

/* Ensure all header elements are vertically aligned */
.app-header .d-flex {
    align-items: center;
}

.app-header .d-flex > * {
    display: flex;
    align-items: center;
}
