/**
 * Global Styles - Chicago Classifieds LocalAd
 * Main stylesheet for the entire application
 */

/* ============================================
   GOOGLE FONTS IMPORT
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ============================================
   CSS VARIABLES / ROOT STYLES
   ============================================ */
:root {
    /* Primary Colors */
    --primary: #333c51;
    --primary-hover: #252b3d;
    --accent-yellow: #D4AF37;
    
    /* Semantic Colors */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* ============================================
   GLOBAL RESETS & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    transition: var(--transition-base);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

/* ============================================
   HEADER & NAVIGATION STYLES
   ============================================ */

/* Sidebar animations */
.sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
}

.sidebar.open {
    transform: translateX(0);
}

/* Overlay */
.overlay {
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-slow);
}

.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Hamburger animation */
.hamburger-line {
    transition: all var(--transition-slow);
}

.hamburger.active .line1 {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .line2 {
    opacity: 0;
}

.hamburger.active .line3 {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Search input focus state */
.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(51, 60, 81, 0.1);
}

/* ============================================
   HOMEPAGE SPECIFIC STYLES
   ============================================ */

/* Gradient Background */
.gradient-bg {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
}

/* Update/Announcement Bar */
.update-bar {
    background: var(--accent-yellow);
    animation: slide-down 0.5s ease-out;
}

@keyframes slide-down {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slide-up {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

.update-bar.closing {
    animation: slide-up 0.3s ease-out forwards;
}

.close-update {
    transition: all var(--transition-base);
}

.close-update:hover {
    transform: scale(1.1);
}

/* Category Chips */
.category-chip {
    transition: all var(--transition-base);
}

.category-chip:hover {
    transform: scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(51, 60, 81, 0.2);
}

/* Category Scroll - Custom Scrollbar */
.category-scroll {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.category-scroll::-webkit-scrollbar {
    height: 6px;
}

.category-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.category-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.category-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Hide scrollbar on mobile */
@media (max-width: 768px) {
    .category-scroll {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .category-scroll::-webkit-scrollbar {
        display: none;
    }
}

/* ============================================
   LISTING CARDS
   ============================================ */

.listing-card {
    transition: all var(--transition-slow);
}

.listing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

@media (max-width: 640px) {
    .listing-card:hover {
        transform: translateY(-2px);
    }
}

/* Featured Badge */
.featured-badge {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    animation: pulse-subtle 2s infinite;
}

@keyframes pulse-subtle {
    0%, 100% { 
        opacity: 1; 
    }
    50% { 
        opacity: 0.8; 
    }
}

/* Loading State for Images */
.listing-card img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

.listing-card img[src] {
    animation: none;
    background: none;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   FORMS & INPUTS
   ============================================ */

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: var(--transition-base);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(51, 60, 81, 0.1);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-error {
    color: var(--danger);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: var(--transition-base);
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-900);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Text Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* Line Clamp */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Display Utilities */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.grid { display: grid; }

/* Animations */
.animate-fadeIn {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

/* Mobile First Breakpoints */
@media (max-width: 640px) {
    .sm\:hidden { display: none; }
}

@media (min-width: 640px) {
    .sm\:block { display: block; }
}

@media (min-width: 768px) {
    .md\:block { display: block; }
}

@media (min-width: 1024px) {
    .lg\:hidden { display: none; }
    .lg\:block { display: block; }
}

/* ============================================
   DASHBOARD STYLES
   ============================================ */

.stats-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.stats-card:hover {
    box-shadow: var(--shadow-lg);
}

/* Table Styles */
.data-table {
    width: 100%;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.data-table th {
    background: var(--gray-50);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.data-table td {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--gray-200);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

/* ============================================
   LOGIN/REGISTER STYLES
   ============================================ */

.auth-container {
    min-height: calc(100vh - 16rem);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 28rem;
    width: 100%;
}

.tab-active {
    border-bottom: 3px solid var(--primary);
    color: var(--primary);
}

.form-container {
    animation: fadeIn 0.3s ease-in;
}

/* ============================================
   MODAL STYLES
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.modal-overlay.active {
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform var(--transition-slow);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* ============================================
   ALERTS & NOTIFICATIONS
   ============================================ */

.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--info);
}

/* Flash Messages */
.flash-message {
    position: relative;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRightOld {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   LOADING STATES
   ============================================ */

.spinner {
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

/* ============================================
   FOOTER STYLES
   ============================================ */

.footer {
    background: #333c51;
    color: white;
    padding: 2rem 1rem;
    margin-top: 3rem;
}

.footer a:hover {
    text-decoration: underline;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}
/* ============================================
   CATEGORY DROPDOWN STYLES
   ============================================ */

/* Wrapper needs relative positioning */
.category-dropdown-wrapper {
    position: relative;
}

/* Dropdown Menu - Hidden by default */
.category-dropdown-menu {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 0.5rem;
    width: 1000px;
    max-width: calc(100vw - 2rem);
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    z-index: 9999;
    max-height: 600px;
    overflow-y: auto;
    padding: 2rem;
}

/* Show on hover - Desktop only */
@media (min-width: 1024px) {
    .category-dropdown-wrapper:hover .category-dropdown-menu {
        display: block;
    }
    
    .category-dropdown-menu:hover {
        display: block;
    }
}

/* Show when has active class */
.category-dropdown-menu.active {
    display: block;
}

/* Never show on mobile */
@media (max-width: 1023px) {
    .category-dropdown-menu {
        display: none !important;
    }
}
/* ============================================
   WISHLIST / FAVORITES STYLES
   ============================================ */

.favorite-btn {
    position: relative;
    transition: all var(--transition-base);
}

.favorite-btn:hover {
    transform: scale(1.1);
}

.favorite-btn.active svg {
    fill: var(--danger);
    stroke: var(--danger);
}

.wishlist-empty {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wishlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .wishlist-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }
}

.remove-favorite-btn {
    opacity: 0;
    transition: all var(--transition-base);
}

.listing-card:hover .remove-favorite-btn {
    opacity: 1;
}

@media (max-width: 768px) {
    .remove-favorite-btn {
        opacity: 1;
    }
}


/* ============================================
   MOBILE FILTER MODAL STYLES
   ============================================ */

/* Hide scrollbar but keep functionality */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Filter Modal */
#filterModal {
    z-index: 9999 !important;
    transition: opacity 0.2s ease-out;
}

#filterModal.hidden {
    display: none !important;
}

#filterModal:not(.hidden) {
    display: block !important;
}

#filterModal > div {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRightOld {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Dropdown arrow for selects in filter bar */
.relative select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.25rem;
}

/* Mobile-specific adjustments */
@media (max-width: 640px) {
    /* Smaller category header on mobile */
    .category-header h1 {
        font-size: 1.25rem !important;
        line-height: 1.75rem !important;
    }
    
    .category-header p {
        font-size: 0.75rem !important;
        line-height: 1rem !important;
    }
}

@media (max-width: 1023px) {
    /* Full width modal on mobile */
    #filterModal > div {
        width: 100% !important;
    }
}


/* Updated Modal Styles - 70% width, no overflow */
#filterModal {
    z-index: 9999 !important;
}

#filterModal > div {
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    animation: slideInFromRight 0.3s ease-out;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Fix overflow in modal */
#filterModal input,
#filterModal select,
#filterModal button,
#filterModal label {
    max-width: 100%;
    word-wrap: break-word;
}

#filterModal .flex {
    flex-wrap: nowrap;
}

/* Sticky bottom button styles */
.fixed.bottom-0.pointer-events-none {
    background: linear-gradient(to top, rgba(255,255,255,1) 60%, rgba(255,255,255,0) 100%);
}

/* Ensure modal doesn't overflow horizontally */
#filterModal * {
    box-sizing: border-box;
}


/* ============================================
   PREMIUM CENTERED MODAL
   ============================================ */

/* Modal backdrop animation */
#filterModal {
    animation: fadeInBackdrop 0.3s ease-out;
    backdrop-filter: blur(2px);
}

#filterModal.hidden {
    display: none !important;
}

@keyframes fadeInBackdrop {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal container animation */
#filterModal > div {
    animation: scaleIn 0.3s ease-out;
    transform-origin: center;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Premium styling for modal content */
#filterModal h3 {
    color: #1f2937;
    font-weight: 700;
    letter-spacing: -0.025em;
}

#filterModal label {
    transition: all 0.2s ease;
}

#filterModal label:hover {
    background-color: #f9fafb;
    padding-left: 0.5rem;
    margin-left: -0.5rem;
    border-radius: 0.5rem;
}

#filterModal input[type="radio"]:checked {
    accent-color: #333c51;
}

#filterModal input[type="number"] {
    transition: all 0.2s ease;
}

#filterModal input[type="number"]:focus {
    border-color: #333c51;
    ring-color: #333c51;
    box-shadow: 0 0 0 3px rgba(51, 60, 81, 0.1);
}

/* Scrollbar styling for modal content */
#filterModal .overflow-y-auto::-webkit-scrollbar {
    width: 8px;
}

#filterModal .overflow-y-auto::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

#filterModal .overflow-y-auto::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

#filterModal .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Prevent modal from being too small on very small screens */
@media (max-height: 600px) {
    #filterModal > div {
        height: 95vh !important;
    }
}

/* Better spacing on mobile */
@media (max-width: 640px) {
    #filterModal > div {
        width: 95% !important;
        max-width: none !important;
    }
}
/* ====================================================================================
   VOLUSIA MARKET - MOBILE & PACKAGE FIXES
   Added: Complete fixes for mobile messages and package badges
   ==================================================================================== */

/* Mobile messaging - hide panels based on viewport */
@media (max-width: 1023px) {
    .mobile-hidden {
        display: none !important;
    }
}

.messages-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    margin-left: -0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.messages-back-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

@media (min-width: 1024px) {
    .messages-back-btn {
        display: none !important;
    }
}

/* Package card styles */
.package-card {
    transition: all 0.3s ease;
    position: relative;
}

.package-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
                0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.package-popular {
    position: relative;
    border: 2px solid #333c51;
    margin-top: 24px !important;
}

.package-popular::before {
    content: "MOST POPULAR";
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    background: #333c51;
    color: white;
    padding: 6px 20px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    letter-spacing: 0.8px;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.package-active {
    border: 3px solid #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
    margin-top: 28px !important;
}

.feature-check {
    color: #10b981;
}

@keyframes pulse-green {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); 
    }
    50% { 
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); 
    }
}

.pulse-green {
    animation: pulse-green 2s infinite;
}

.packages-grid {
    padding-top: 2rem;
}

@media (max-width: 768px) {
    .package-popular::before {
        font-size: 10px;
        padding: 5px 14px;
        top: -14px;
    }
    
    .package-popular,
    .package-active {
        margin-top: 20px !important;
    }
    
    .packages-grid {
        padding-top: 1.5rem;
    }
}
/* Active Package Badge - Fixed padding and positioning */
.package-active {
    border: 3px solid #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
    margin-top: 50px !important; /* More space at top */
    position: relative;
}

.package-active::before {
    content: "ACTIVE PACKAGE";
    position: absolute;
    top: -24px; /* Higher up so it doesn't cut */
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 6px 12px; /* REDUCED left/right padding from 18px to 12px */
    font-size: 11px;
    font-weight: 700;
    border-radius: 20px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
    z-index: 10;
}

/* REMOVE the cutting off "MOST POPULAR" badge */
.package-popular {
    position: relative;
    border: 2px solid #333c51;
    margin-top: 20px !important; /* Less space since no badge above */
}

/* REMOVE this entirely - it's the one cutting off */
.package-popular::before {
    display: none !important; /* Don't show at all */
}

/* Keep the blue POPULAR badge (this is in the HTML, not CSS) */
/* The blue badge you see is rendered in the HTML, we're keeping that */

.packages-grid {
    padding-top: 3rem;
}

.package-card {
    transition: all 0.3s ease;
    position: relative;
}

.package-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
                0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.feature-check {
    color: #10b981;
}

@keyframes pulse-green {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); 
    }
    50% { 
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); 
    }
}

.pulse-green {
    animation: pulse-green 2s infinite;
}

@media (max-width: 768px) {
    .package-active::before {
        font-size: 10px;
        padding: 5px 10px;
        top: -20px;
    }
    
    .package-active {
        margin-top: 40px !important;
    }
    
    .packages-grid {
        padding-top: 2rem;
    }
}

/* Mobile messaging styles */
@media (max-width: 1023px) {
    .mobile-hidden {
        display: none !important;
    }
}

.messages-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    margin-left: -0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.messages-back-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

@media (min-width: 1024px) {
    .messages-back-btn {
        display: none !important;
    }
}
/* ================================================================
   MOBILE MESSAGES LAYOUT FIXES
   Add this to style.css
   ================================================================ */

/* Fix chat header on mobile - stack items vertically */
@media (max-width: 768px) {
    /* Chat header - make it wrap on mobile */
    #chatView .p-4.border-b .flex.items-center.justify-between {
        flex-wrap: wrap !important;
    }
    
    /* User info section - take full width on mobile */
    #chatView .p-4.border-b .flex.items-center.gap-3.flex-1 {
        width: 100% !important;
        flex: 1 1 100% !important;
        margin-bottom: 12px;
    }
    
    /* Make Offer button - full width below on mobile */
    #chatView .p-4.border-b button[onclick="openMakeOffer()"] {
        width: 100% !important;
        flex: 1 1 100% !important;
        justify-content: center;
    }
    
    /* User name and listing title - allow proper wrapping */
    #chatView .p-4.border-b .min-w-0 {
        max-width: 100%;
    }
    
    #chatView .p-4.border-b h3,
    #chatView .p-4.border-b .text-sm.text-\[0066cc\] {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }
}

/* Fix chat container height - prevent scrolling to footer */
#chatView {
    max-height: calc(100vh - 180px) !important;
    display: flex !important;
    flex-direction: column !important;
}

@media (max-width: 1023px) {
    #chatView {
        max-height: 100vh !important;
        height: 100vh !important;
    }
}

/* Messages container - proper scrolling */
#messagesContainer {
    flex: 1 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* Message form - stick to bottom */
#chatView form[id="messageForm"] {
    flex-shrink: 0 !important;
}