:root { 
    /* Modern Color Palette */
    --bg-body: #e0e0e0;
    --bg-card: #e0e0e0;
    --bg-input: #f0f0f0;
    
    /* Neumorphic Shadows - Global Config (Refined for "Apple" Cleanliness) */
    --nm-shadow-out: 12px 12px 24px #c8d0e7, -12px -12px 24px #ffffff;
    --nm-shadow-in: inset 6px 6px 12px #c8d0e7, inset -6px -6px 12px #ffffff;
    --nm-shadow-sm: 4px 4px 8px #c8d0e7, -4px -4px 8px #ffffff;
    --nm-radius: 30px;
    
    --primary: #4f46e5; /* Indigo 600 */
    --primary-hover: #4338ca; /* Indigo 700 */
    --primary-light: #eef2ff; /* Indigo 50 */
    
    --text-main: #111827; /* Gray 900 - Darker, sharper text */
    --text-muted: #6b7280; /* Gray 500 */
    
    --border: #e5e7eb; /* Gray 200 */
    --border-focus: #2563eb;
    
    --success: #10b981; /* Emerald 500 */
    --success-bg: #ecfdf5; /* Emerald 50 */
    --danger: #ef4444; /* Red 500 */
    --danger-bg: #fef2f2; /* Red 50 */
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

body { 
    background-color: var(--bg-body);
    /* Grid Pattern Background */
    background-image: linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    
    color: var(--text-main); 
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 100px; /* Reduced padding */
}

main {
    flex: 1;
}

/* Sticky Header Styles - Always Opaque */
header.sticky-top {
    background-color: #e0e0e0 !important; /* Fully opaque background matching body */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05); /* Subtle border for separation */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); /* Soft shadow */
    transition: none; /* Remove transition to prevent flicker */
    z-index: 1030; /* Ensure it stays on top */
}

/* Remove the scrolled state difference since user wants it always opaque */
header.sticky-top.scrolled {
    background-color: #e0e0e0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
h1, h2, h3, h4, h5, h6 { color: var(--text-main); font-weight: 700; letter-spacing: -0.025em; }

.brand { 
    font-size: 3rem; 
    font-weight: 800; 
    background: linear-gradient(135deg, #2563eb, #4f46e5); 
    background-clip: text;
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.brand:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

/* Layout & Cards */
.container { max-width: 1200px; } /* Increased max-width for more breathing room */

/* Desktop Layout Adjustments */
@media (min-width: 992px) {
    .row.g-4 {
        --bs-gutter-x: 3rem; /* Increase gap between columns */
    }
}

/* Base Neumorphic Card System */
.nm-card {
    background: var(--bg-card);
    border-radius: var(--nm-radius);
    box-shadow: var(--nm-shadow-out);
    border: none;
    transition: all 0.3s ease;
    padding: 1.5rem;
}

.nm-card-sm {
    border-radius: calc(var(--nm-radius) / 2);
    box-shadow: var(--nm-shadow-sm);
    padding: 1rem;
}

.nm-inset {
    box-shadow: var(--nm-shadow-in) !important;
}

/* Specific Card Overrides */
.card { 
    border: none; 
    border-radius: 40px; 
    background: #e0e0e0; 
    box-shadow: var(--nm-shadow-out);
    transition: transform 0.2s ease, box-shadow 0.2s ease; 
    overflow: visible; 
    z-index: 10;
}

.main-card { position: relative; }

/* Forms - Apple Style Unified Design */
.form-label { 
    font-size: 1rem; 
    font-weight: 600; 
    color: var(--text-main); 
    margin-bottom: 0.75rem; 
    padding-left: 0.5rem;
}

.input-group { 
    background-color: var(--bg-input);
    border: none;
    border-radius: 30px; 
    box-shadow: inset 4px 4px 8px #c8d0e7, inset -4px -4px 8px #ffffff;
    overflow: hidden; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    min-height: 56px;
}

.input-group:hover {
    box-shadow: inset 2px 2px 5px #c8d0e7, inset -2px -2px 5px #ffffff;
}

.input-group:focus-within { 
    background-color: var(--bg-input);
    box-shadow: inset 2px 2px 4px #c8d0e7, inset -2px -2px 4px #ffffff; 
}

.input-group-text { 
    background-color: transparent; 
    border: none; 
    color: var(--text-muted); 
    padding-left: 1.25rem;
    padding-right: 0.75rem;
    transition: color 0.2s;
    font-size: 1.1rem;
}

.input-group:focus-within .input-group-text {
    color: var(--primary);
}

.form-control { 
    background-color: transparent; 
    border: none; 
    color: var(--text-main); 
    padding: 1rem 1.25rem 1rem 0; 
    font-size: 1.05rem; 
    font-weight: 500; 
    width: 100%;
}

.form-control:focus { 
    background-color: transparent; 
    border: none; 
    box-shadow: none !important; 
    outline: none;
}

.form-control::placeholder { 
    color: #9ca3af; 
    font-weight: 400; 
    opacity: 0.8;
}

/* Buttons */
.btn { 
    padding: 1rem 2rem; 
    border-radius: 30px; 
    font-weight: 600; 
    letter-spacing: 0.02em; 
    transition: all 0.2s; 
    font-size: 1.05rem;
}

/* Neumorphic Button Style from Uiverse.io */
.btn-primary {
    color: #090909 !important; /* Force dark text */
    padding: 0.7em 1.7em;
    font-size: 18px;
    border-radius: 0.5em;
    background: #e8e8e8;
    cursor: pointer;
    border: 1px solid #e8e8e8;
    transition: all 0.3s;
    box-shadow: 
        6px 6px 12px #c5c5c5, 
        -6px -6px 12px #ffffff;
}

.btn-primary:hover {
    /* Optional: slightly darken or lift on hover to enhance interaction */
    background: #e8e8e8;
    color: #090909 !important; /* Keep text dark */
    transform: translateY(-2px);
    box-shadow: 
        8px 8px 16px #c5c5c5, 
        -8px -8px 16px #ffffff;
}

.btn-primary:active, .btn-primary:focus {
    background: #e8e8e8 !important; /* Keep background gray */
    color: #666 !important;
    border-color: #e8e8e8 !important; /* Prevent blue border */
    box-shadow: 
        0px 0px 0px #c5c5c5, 
        0px 0px 0px #ffffff, 
        inset 4px 4px 12px #c5c5c5, 
        inset -4px -4px 12px #ffffff !important; /* Force inset shadow */
    transform: translateY(0);
    outline: none !important; /* Remove focus ring */
}

/* Ensure text is visible and overrides bootstrap defaults */
.btn-primary .btn-text {
    font-weight: 600;
}

.btn-reset { 
    background: #e0e0e0; 
    border: none; 
    color: var(--text-muted); 
    box-shadow: 6px 6px 12px #c8d0e7, -6px -6px 12px #ffffff;
    padding: 1rem;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-reset:hover { 
    background: #e0e0e0; 
    color: var(--text-main); 
    transform: translateY(-2px);
    box-shadow: 8px 8px 16px #c8d0e7, -8px -8px 16px #ffffff;
}

.btn-reset:active {
    box-shadow: inset 4px 4px 8px #c8d0e7, inset -4px -4px 8px #ffffff;
    transform: translateY(0);
}

.rotate-once {
    animation: rotate360 0.6s ease-in-out;
}

@keyframes rotate360 {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}


/* Override Chrome Autocomplete Background */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    /* 使用 box-shadow 强制覆盖背景色为我们的 Neumorphism 灰色 */
    -webkit-box-shadow: 0 0 0 1000px #e0e0e0 inset !important;
    /* 保持文字颜色 */
    -webkit-text-fill-color: var(--text-main) !important;
    transition: background-color 5000s ease-in-out 0s;
    /* 保持圆角 */
    border-radius: 12px !important;
}

/* 自动填充状态下模拟内阴影效果 (通过额外的 shadow 层) */
/* 注意：autofill 比较特殊，很难完美还原 inset shadow，
   这里用纯色背景覆盖是最稳妥的方案，至少不会出现白色/蓝色突兀块 */

/* Results */
.result-item { 
    background: #e0e0e0; 
    border-radius: 20px; 
    padding: 1rem 1.25rem; 
    box-shadow: 8px 8px 16px #c8d0e7, -8px -8px 16px #ffffff;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

/* Mobile Result Card Optimization - Ultra Compact & Aesthetic */
@media (max-width: 576px) {
    .result-item {
        padding: 0.75rem 0.85rem;
        margin-bottom: 0.25rem;
    }
    
    /* Layout: Top row (Icon + Name + Best Badge) | Middle row (Meta) | Bottom row (Price + Details) */
    .result-item .d-flex.align-items-start.justify-content-between {
        display: grid !important;
        grid-template-areas: 
            "header price"
            "meta price"
            "footer footer";
        grid-template-columns: 1fr auto;
        gap: 0.25rem;
    }

    /* Area definitions */
     .result-item .d-flex.align-items-center:first-child { 
         grid-area: header;
         width: 100%;
         display: flex !important;
         align-items: center !important;
         flex-wrap: nowrap !important;
     }
     
     .result-item .meta {
         grid-area: meta;
         margin-top: -4px;
         opacity: 0.8;
         font-size: 0.7rem;
         white-space: nowrap;
         overflow: hidden;
         text-overflow: ellipsis;
     }

    .result-item .text-end {
        grid-area: price;
        display: flex;
        flex-direction: column;
        justify-content: flex-start; /* Changed from center to flex-start for top alignment */
        align-items: flex-end;
        margin-top: 0 !important; /* Fixed alignment with company name */
    }

    .result-item .d-flex.align-items-center.justify-content-end.mt-2 {
        grid-area: footer;
        margin-top: 0.5rem !important;
        padding-top: 0.5rem !important;
    }

    /* Element scaling */
    .company-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        margin-right: 0.6rem;
        box-shadow: inset 2px 2px 4px #c8d0e7, inset -2px -2px 4px #ffffff;
    }

    .company-name {
        font-size: 0.95rem;
    }

    .badge-best {
        font-size: 0.55rem;
        padding: 0.15rem 0.4rem;
        border-radius: 8px;
    }

    .price-tag {
        font-size: 1.35rem;
        letter-spacing: -0.5px;
    }

    .diff-tag {
        font-size: 0.65rem;
        padding: 2px 6px;
        margin-top: 2px;
    }

    .log-toggle-link {
        font-size: 0.75rem !important;
    }
}

.badge-best { 
    background: linear-gradient(135deg, #10b981, #059669); 
    color: white; 
    padding: 0.3em 0.8em; 
    border-radius: 12px; 
    font-size: 0.7rem; 
    font-weight: 700; 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
    display: inline-flex; 
    align-items: center; 
    gap: 4px; 
    box-shadow: 2px 2px 4px #c8d0e7, -2px -2px 4px #ffffff;
}

.company-icon { 
    width: 42px; 
    height: 42px; 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.25rem; 
    flex-shrink: 0; 
    margin-right: 1rem;
    background: #e0e0e0;
    box-shadow: inset 3px 3px 6px #c8d0e7, inset -3px -3px 6px #ffffff;
}

.icon-redur { color: #dc2626; }
.icon-zeleris { color: #2563eb; }

.price-tag { 
    font-family: 'Inter', sans-serif; 
    font-size: 1.5rem; 
    font-weight: 800; 
    color: var(--text-main); 
    line-height: 1; 
    text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}

.price-tag span { 
    font-size: 0.9rem; 
    color: var(--text-muted); 
    font-weight: 600; 
    margin-left: 2px;
}

.diff-tag { 
    display: inline-block; 
    background: #e0e0e0; 
    color: var(--danger); 
    padding: 4px 8px; 
    border-radius: 12px; 
    font-size: 0.75rem; 
    font-weight: 700; 
    margin-top: 0.25rem; 
    box-shadow: inset 2px 2px 5px #c8d0e7, inset -2px -2px 5px #ffffff;
}

.company-name { font-size: 1.1rem; font-weight: 800; color: var(--text-main); margin-bottom: 0; }
.meta { color: var(--text-muted); font-size: 0.8rem; margin-top: 2px; font-weight: 500; }

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

.suggest { position: relative; }
.suggest-list { 
    position: absolute; 
    z-index: 1060; 
    left: 10px; 
    right: 10px; 
    top: 100%; 
    background: #e0e0e0; 
    border: none; 
    /* 
       下拉菜单阴影调整 (Suggest List Shadow):
       如果不自然，可以尝试减小数值，或者只保留单侧阴影。
       
       当前设置 (更柔和):
       box-shadow: 6px 6px 12px #c8d0e7, -6px -6px 12px #ffffff;
    */
    box-shadow: 6px 6px 12px #c8d0e7, -6px -6px 12px #ffffff;
    border-radius: 20px; 
    margin-top: 8px; /* 拉近与输入框的距离 */
    overflow: hidden; 
    max-height: 300px; 
    overflow-y: auto; 
    padding: 10px;
    
    /* 
       Optimization: Hardware acceleration for smooth scrolling on mobile
    */
    -webkit-overflow-scrolling: touch;
}

/* Custom Scrollbar for Suggest List (Round & Aesthetic) */
.suggest-list::-webkit-scrollbar {
    width: 6px;
}

.suggest-list::-webkit-scrollbar-track {
    background: transparent;
    margin: 10px 0; /* Vertical margin to avoid hitting rounded corners */
}

.suggest-list::-webkit-scrollbar-thumb {
    background-color: #d1d5db; /* Gray 300 */
    border-radius: 10px;
    transition: background-color 0.2s;
}

.suggest-list::-webkit-scrollbar-thumb:hover {
    background-color: #9ca3af; /* Gray 400 */
}

/* Mobile & Landscape Optimization for Dropdown */
@media (max-height: 600px) {
    .suggest-list {
        max-height: 180px; /* Reduce height on short screens/landscape */
    }
}

.suggest-item { 
    padding: 14px 20px; 
    cursor: pointer; 
    font-size: 1rem; 
    border-bottom: none; 
    border-radius: 15px;
    transition: all 0.2s; 
    color: var(--text-main);
    margin-bottom: 4px;
}

.suggest-item:hover { 
    background: #e0e0e0; 
    box-shadow: inset 4px 4px 8px #c8d0e7, inset -4px -4px 8px #ffffff;
    color: var(--text-main);
    font-weight: 700;
}

/* Loading Spinner */
.spinner-border-sm { 
    width: 1.25rem; 
    height: 1.25rem; 
    border-width: 0.15em; 
    color: #4a5568; /* Match the gray theme */
}

.log-toggle { 
    background: #e0e0e0; 
    border: none; 
    color: var(--text-muted); 
    border-radius: 15px; 
    padding: 10px 20px;
    box-shadow: 5px 5px 10px #c8d0e7, -5px -5px 10px #ffffff;
    font-weight: 600;
    transition: all 0.2s;
}
.log-toggle:hover { 
    color: var(--text-main); 
    transform: translateY(-2px);
    box-shadow: 7px 7px 14px #c8d0e7, -7px -7px 14px #ffffff;
}
.log-toggle:active {
    transform: translateY(0);
    box-shadow: inset 3px 3px 6px #c8d0e7, inset -3px -3px 6px #ffffff;
}

/* Log Timeline Style */
 .log-box { 
     background: #f8f9fa; /* Lighter background */
     border: 1px solid rgba(0,0,0,0.05); 
     border-radius: 12px; 
     color: var(--text-main); 
     padding: 1rem;
     margin-top: 0; /* Removed margin to prevent jump */
     padding-top: 1rem; /* Ensure spacing inside */
     box-shadow: none; /* Remove inset shadow for cleaner look */
     transform: translate3d(0,0,0); /* Force GPU layer with 3d */
     backface-visibility: hidden; /* Fix mobile flickering */
     perspective: 1000px;
     contain: content; /* Isolate internal layout */
 }
 
 .log-list {
     display: flex;
     flex-direction: column;
     gap: 0;
     position: relative;
     padding-left: 1rem;
 }
 
 /* Timeline Line */
 .log-list::before {
     content: '';
     position: absolute;
     left: 0;
     top: 6px;
     bottom: 6px;
     width: 2px;
     background: #e5e7eb;
     border-radius: 2px;
 }

 .log-list li {
     color: #4b5563 !important; 
     font-size: 0.75rem;
     line-height: 1.4;
     display: flex;
     align-items: flex-start;
     padding: 4px 0 4px 12px;
     position: relative;
 }
 
 /* Timeline Dots */
 .log-list li::before {
     content: '';
     position: absolute;
     left: -4px;
     top: 8px;
     width: 10px;
     height: 10px;
     border-radius: 50%;
     background: white;
     border: 2px solid #9ca3af;
     z-index: 1;
     transition: all 0.2s;
 }
 
 .log-list li:hover::before {
     background: #4a5568;
     border-color: #4a5568;
     transform: scale(1.2);
 }
 
 .log-list li:hover {
     color: var(--text-main) !important;
 }
 
 /* Highlight specific keywords */
 .log-highlight {
     color: #4a5568;
     font-weight: 700;
     padding: 2px 6px;
     background: rgba(0, 0, 0, 0.05);
     border-radius: 6px;
     margin: 0 2px;
 }

 /* Sticky Sidebar for Desktop */
@media (min-width: 992px) {
   .sticky-sidebar {
       position: -webkit-sticky;
       position: sticky;
       top: 2rem;
       z-index: 1020;
       align-self: flex-start;
       /* 
          Fix: Removed max-height and overflow-y to allow suggestion list 
          to overflow naturally without being clipped. 
          Note: On very short screens, this might cause the bottom of the form 
          to be inaccessible if pinned. But visual integrity of the dropdown is prioritized.
       */
       /* max-height: calc(100vh - 4rem); */
       /* overflow-y: auto; */
   }
}

 /* Mobile optimizations */
@media (max-width: 991.98px) {
    /* Consolidated mobile styles moved to the dedicated block at line 797 */
}
 
 /* Playful Animations */
@keyframes jellyPop {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.15); opacity: 1; }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.jelly-pop {
    animation: jellyPop 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* Utility Classes for JS toggles */
.weather-badge {
    font-size: 0.75rem;
    font-weight: 500;
    background: white;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 0.35em 0.8em;
    border-radius: 9999px; /* Pill shape for cuteness */
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    /* Interaction */
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    /* Initial state hidden or transparent handled by JS/CSS display */
}
 
 .weather-badge:hover {
    transform: translateY(-2px);
    box-shadow: 4px 4px 8px #c8d0e7, -4px -4px 8px #ffffff;
    color: var(--primary);
    border-color: var(--primary-light);
}

.weather-badge:active {
    transform: translateY(1px);
    box-shadow: inset 2px 2px 4px #c8d0e7, inset -2px -2px 4px #ffffff;
}

.driving-badge {
   animation: jellyPop 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
   cursor: pointer;
   transition: all 0.2s ease;
   user-select: none;
   box-shadow: var(--shadow-sm);
   /* Desktop: One line, aligned left, pill shape */
   white-space: nowrap !important;
   overflow: visible !important; /* Prevent truncation */
   height: auto !important;
   line-height: 1.5;
   text-align: left;
   max-width: none !important; /* Allow it to grow */
   display: inline-flex;
   align-items: center;
   padding: 0.4rem 1rem;
   border-radius: 9999px !important; /* Pill shape */
   border: 1px solid var(--border) !important;
}

.driving-badge:hover {
    transform: translateY(-2px);
    box-shadow: 4px 4px 8px #c8d0e7, -4px -4px 8px #ffffff;
    border-color: var(--primary-light) !important;
}

.driving-badge:active {
    transform: translateY(1px);
    box-shadow: inset 2px 2px 4px #c8d0e7, inset -2px -2px 4px #ffffff;
}
 
 .alert-clean {
     background-color: #fffbeb; /* Amber 50 */
     color: #92400e; /* Amber 800 */
     border: 1px solid #fcd34d; /* Amber 300 */
     border-radius: 12px;
 }
 
 .btn-copy-sm {
     font-size: 0.8rem !important;
     padding: 0.1rem 0.5rem !important;
 }
 
 .badge-count {
    background: white !important;
    color: var(--primary) !important;
    border: 1px solid var(--primary) !important;
    font-weight: 600 !important;
    padding: 0.4rem 0.8rem !important;
    border-radius: 9999px !important;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
 }
 
 .badge-count:hover {
    background: var(--primary) !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: var(--nm-shadow-sm);
 }

 /* Responsive Results Header Layout */
.results-header {
    /* flex-wrap: wrap; Removed to prevent unwanted wrapping on desktop */
    gap: 0.5rem;
}

/* Mobile specific adjustments for results header */
@media (max-width: 576px) {
    .results-header {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    /* Let bootstrap classes handle the width/layout inside */
    /* .results-header > div:first-child { width: 100%; justify-content: space-between; } */
    
    .driving-badge {
        font-size: 0.75rem; /* Smaller text on mobile */
        margin-top: 0.25rem;
        display: inline-flex !important; /* Ensure flex behavior */
        width: 100%; /* Full width */
        justify-content: center; /* Center content */
    }
}
 .results-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    pointer-events: none; /* Prevent hover on gaps */
}

/* Remove margin-bottom from items as we use gap now */
.results-container .result-item {
    margin-bottom: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: auto; /* Re-enable events for cards */
    /* Performance Optimization: Reduce reflow impact */
    /* content-visibility: auto; */
    /* contain-intrinsic-size: 100px; */
    will-change: transform; /* Hint for hover effects */
}
 
 .results-container:hover .result-item:not(:hover) {
     filter: blur(4px) grayscale(40%);
     transform: scale(0.96);
     opacity: 0.7;
 }
 
 .results-container .result-item:hover {
     transform: scale(1.02);
     z-index: 10;
     box-shadow: var(--shadow-xl);
     border-color: var(--primary-light);
 }
 
 /* Contact Item Styles - Neumorphic */
.contact-item {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 50px;
    background: #e0e0e0;
    box-shadow: 5px 5px 10px #c8d0e7,
                -5px -5px 10px #ffffff;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.contact-item:hover {
    transform: translateY(-2px);
    color: var(--primary);
    box-shadow: 6px 6px 12px #c8d0e7,
                -6px -6px 12px #ffffff;
}

.contact-item:active {
    transform: translateY(1px);
    box-shadow: inset 3px 3px 6px #c8d0e7,
                inset -3px -3px 6px #ffffff;
}
 
 .contact-item i {
    font-size: 1.1em;
    margin-right: 0;
    transition: color 0.2s ease;
}

.contact-text {
    margin-left: 6px;
}

/* Neumorphic Detail Toggle Button - Refined Inset */
.log-toggle-link {
    background: #f0f2f5;
    border: none !important;
    border-radius: 12px;
    padding: 6px 14px !important;
    font-size: 0.75rem !important;
    font-weight: 600;
    color: #7a7a7a !important;
    box-shadow: inset 2px 2px 5px #c8d0e7, inset -2px -2px 5px #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none !important;
    outline: none !important;
    cursor: pointer;
}

.log-toggle-link:hover {
    color: #4a5568 !important;
    box-shadow: inset 3px 3px 7px #c8d0e7, inset -3px -3px 7px #ffffff;
    background: #eceef2;
}

.log-toggle-link:active {
    box-shadow: inset 5px 5px 10px #c8d0e7, inset -5px -5px 10px #ffffff;
    transform: scale(0.98);
}

.log-toggle-link i {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.log-toggle-link[aria-expanded="true"] {
    color: #4a5568 !important;
    box-shadow: 2px 2px 5px #c8d0e7, -2px -2px 5px #ffffff; /* Outset when open */
    background: #f0f2f5;
}

.log-toggle-link[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* Refined Log Box (Details popout) - Timeline Style */
.log-box {
    background: #f0f2f5;
    border-radius: 20px;
    padding: 1.5rem;
    margin-top: 1rem;
    box-shadow: inset 5px 5px 10px #c8d0e7, inset -5px -5px 10px #ffffff;
    border: none;
    position: relative;
}

.log-list {
    position: relative;
    padding-left: 20px;
    border-left: 2px solid #d1d9e6;
    margin-left: 10px;
}

.log-list li {
    position: relative;
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 2px 2px 4px #d1d9e6, -2px -2px 4px #ffffff;
    transition: all 0.3s ease;
    list-style: none;
    color: #666;
    font-size: 0.75rem;
    line-height: 1.4;
}

.log-list li::before {
    content: "";
    position: absolute;
    left: -27px;
    top: 12px;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 2px solid #d1d9e6;
    border-radius: 50%;
    z-index: 1;
    transition: all 0.3s ease;
}

.log-list li:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.8);
    color: #333;
}

.log-list li:hover::before {
    border-color: #4a5568;
    background: #4a5568;
    box-shadow: 0 0 0 4px rgba(74, 85, 104, 0.1);
}

/* Modal Neumorphic Refinement */
.modal-content.neumorphic {
    background: #f0f2f5;
    border-radius: 28px;
    box-shadow: 20px 20px 60px #d1d9e6, -20px -20px 60px #ffffff;
    padding: 1rem;
}

.modal-backdrop.show {
    opacity: 0.4;
    backdrop-filter: blur(8px);
}

/* Carriers List Item Refinement */
.carrier-item {
    background: #f0f2f5 !important;
    border-radius: 20px !important;
    margin-bottom: 12px;
    padding: 1rem !important;
    box-shadow: 6px 6px 12px #d1d9e6, -6px -6px 12px #ffffff;
    transition: all 0.3s ease;
    border: none !important;
}

.carrier-item:hover {
    transform: translateY(-2px);
    box-shadow: 8px 8px 16px #c1c9d6, -8px -8px 16px #ffffff;
}

.carrier-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;    align-items: center;
    justify-content: center;
    box-shadow: inset 2px 2px 5px #d1d9e6, inset -2px -2px 5px #ffffff;
    background: #f0f2f5;
}

/* Fix mobile modal shift */
body.modal-open {
    padding-right: 0 !important;
    overflow: hidden;
}

.modal {
    padding-right: 0 !important;
}
 
 /* Floating Footer */
 footer {
     position: fixed;
     bottom: 0;
     left: 0;
     width: 100%;
     z-index: 1030;
     background: rgba(224, 224, 224, 0.85);
     backdrop-filter: blur(10px);
     -webkit-backdrop-filter: blur(10px);
     border-top: 1px solid rgba(255, 255, 255, 0.3);
     box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
     padding-top: 0.5rem !important;
     padding-bottom: 0.5rem !important;
     margin-top: 0 !important;
 }
 
 /* Rate Management Link Style - Neumorphic */
.rate-mgmt-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #e0e0e0;
    border: none;
    border-radius: 20px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 5px 5px 10px #bebebe, -5px -5px 10px #ffffff;
    position: relative;
}

.rate-mgmt-link:hover {
    transform: translateY(-2px);
    color: var(--primary);
    box-shadow: 7px 7px 14px #bebebe, -7px -7px 14px #ffffff;
    z-index: 1;
}

.rate-mgmt-link:active {
    transform: translateY(1px);
    box-shadow: inset 3px 3px 6px #bebebe, inset -3px -3px 6px #ffffff;
}

.rate-mgmt-link i {
    font-size: 1.1em;
    transition: transform 0.5s ease;
}

.rate-mgmt-link:hover i {
    transform: rotate(90deg);
}

/* Smooth Collapse Animation for Mobile */
.collapsing {
    will-change: height;
    transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Adjust body to prevent footer overlap */
body {
    padding-bottom: 100px; /* Reduced padding */
}

/* Contact items in footer */
footer .contact-item {
    margin: 0;
}
/* Mobile Header & Footer Optimization */
@media (max-width: 991.98px) {
    /* Remove body padding on mobile to remove bottom white space */
    html, body {
        /* Add enough padding to prevent footer overlap, but keep it tight */
        padding-bottom: 70px !important; 
        margin-bottom: 0 !important;
        height: auto !important; /* Allow scroll */
        min-height: 100%;
    }

    /* Global Container Padding Reduction */
    .container.py-5 {
        padding-top: 1rem !important;
        padding-bottom: 0 !important; /* Remove bottom padding completely */
        /* Removed flex centering to keep header at top */
    }

    /* Push Main Card Down */
    .main-card {
        margin-top: 2rem !important; /* Adjust this value to push card further down */
    }

    /* Header Compactness */
    .header-container {
        /* Sticky Header Logic */
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        z-index: 1040;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        
        /* Initial State - Fixed transparency issue */
        background: #e0e0e0 !important;
        margin-left: -1rem; /* Compensate for container padding */
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 0.5rem; /* Add safe area */
        padding-bottom: 0.5rem;
        
        /* Flex Alignment */
        align-items: center !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Active Floating State (toggled via JS) */
    .header-floating {
        background: #e0e0e0 !important; /* Solid background, no transparency */
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.05);
        border-bottom: 1px solid rgba(255,255,255,0.3);
        padding-top: 0.75rem; /* Slightly taller when floating */
        padding-bottom: 0.75rem;
    }
    
    .header-brand-group {
        display: flex;
        align-items: center;
        flex-wrap: nowrap; /* Force single line */
        gap: 0.5rem;
    }
    
    .brand {
        font-size: 1.25rem !important; /* Smaller size */
        margin-bottom: 0 !important;
    }
    
    .brand img {
        width: 24px !important; /* Even smaller logo */
        height: 24px !important;
        margin-right: 0.25rem !important;
    }
    
    .header-brand-group p {
        font-size: 0.75rem !important;
        margin-bottom: 0 !important;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 130px; 
    }
    
    .rate-mgmt-link {
        font-size: 0.75rem !important;
        padding: 0.25rem 0.5rem !important; /* Tighter button */
        white-space: nowrap;
    }

    /* Footer Compactness */
    footer {
        padding-top: 0 !important; /* Remove wrapper padding */
        padding-bottom: 0 !important;
    }

    footer.mt-5 {
        margin-top: 0 !important;
    }
    
    footer .container {
        padding-top: 5px !important; /* Minimal top spacing */
        padding-bottom: 5px !important; /* Minimal bottom spacing */
        gap: 2px !important; /* Reduce gap between buttons and copyright */
    }
    
    footer .contact-item {
        /* Slightly smaller padding */
        padding: 4px 8px !important;
        font-size: 0.8rem !important; 
        box-shadow: 2px 2px 5px rgba(0,0,0,0.1), -2px -2px 5px rgba(255,255,255,0.8) !important; /* Flatter shadow */
    }
    
    /* Hide text on mobile to fit in one line, show icons only */
    .contact-item span:not(.bi), /* Assuming text is wrapped or bare text nodes */
    .contact-item .contact-text {
        display: none !important;
    }
    
    .contact-item i {
        font-size: 1.1rem; /* Restore icon size */
        margin-right: 0 !important; /* Remove margin between icon and hidden text */
    }
    
    footer .gap-3 {
        gap: 6px !important; /* Specific pixel gap */
    }
    
    footer p {
        font-size: 0.6rem !important;
        margin-top: 2px !important;
        margin-bottom: 0 !important;
        opacity: 0.6;
    }
}

/* --- Restored Custom CSS --- */

/* Company Icon Backgrounds */
.icon-redur-bg { background-color: #dc2626 !important; }
.icon-zeleris-bg { background-color: #3b82f6 !important; }

/* Active Carriers Badge Hover & Click Effects */
.btn-neumorphic {
    background: #e0e0e0;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    color: var(--text-main);
    font-weight: 600;
    box-shadow: 5px 5px 10px #bebebe, -5px -5px 10px #ffffff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.btn-neumorphic:hover {
    transform: translateY(-2px);
    box-shadow: 7px 7px 14px #bebebe, -7px -7px 14px #ffffff;
    color: var(--primary);
    z-index: 1;
}

.btn-neumorphic:active, .btn-neumorphic.show {
    transform: translateY(1px);
    box-shadow: inset 3px 3px 6px #bebebe, inset -3px -3px 6px #ffffff;
    color: var(--primary);
}

/* Legal Modals Customization & Animation */
.modal-content.neumorphic {
    background: #e0e0e0;
    border: none;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    /* Hardware acceleration */
    transform: translateZ(0);
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* Custom Modal Animation: Zoom/Pop Effect */
.modal.fade .modal-dialog {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease-out;
    transform: scale(0.92); /* Start slightly smaller */
    opacity: 0;
}

.modal.show .modal-dialog {
    transform: none; /* Scale to 1 */
    opacity: 1;
}

/* --- Cookie Consent Card & Animations --- */
.cookie-banner {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    right: 2rem;
    max-width: 500px;
    background: #e0e0e0;
    padding: 1.5rem;
    border-radius: 24px;
    box-shadow: 10px 10px 20px #bebebe, -10px -10px 20px #ffffff;
    z-index: 9999;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translateY(120%) scale(0.9);
    opacity: 0;
    display: flex !important; /* Force flex for layout */
    visibility: hidden;
}

.cookie-banner.show {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.cookie-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

.cookie-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cookie-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 4px 4px 8px #bebebe, -4px -4px 8px #ffffff;
    flex-shrink: 0;
}

.cookie-text {
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.5;
}

.cookie-text strong {
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.25rem;
    color: var(--primary);
}

.cookie-buttons {
    display: flex;
    gap: 12px;
}

.cookie-buttons button {
    flex: 1;
    padding: 10px 20px;
    border: none;
    border-radius: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-cookie-accept {
    background: var(--primary);
    color: white;
    box-shadow: 4px 4px 8px #bebebe, -4px -4px 8px #ffffff;
}

.btn-cookie-accept:hover {
    transform: translateY(-2px);
    box-shadow: 6px 6px 12px #bebebe, -6px -6px 12px #ffffff;
    background: #1d4ed8;
}

.btn-cookie-reject {
    background: #e0e0e0;
    color: var(--text-muted);
    box-shadow: 5px 5px 10px #bebebe, -5px -5px 10px #ffffff;
}

.btn-cookie-reject:hover {
    transform: translateY(-2px);
    color: var(--primary);
    box-shadow: 6px 6px 12px #bebebe, -6px -6px 12px #ffffff;
}

.btn-cookie-reject:active, .btn-cookie-accept:active {
    transform: translateY(1px);
    box-shadow: inset 2px 2px 5px #bebebe, inset -2px -2px 5px #ffffff;
}

/* Mobile Adjustments for Cookie Card */
@media (max-width: 576px) {
    .cookie-banner {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        padding: 1.25rem;
    }
    
    .cookie-buttons {
        flex-direction: column;
    }
    
    .cookie-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}

/* SEO Landing Features */
.landing-features {
    padding: 1rem 0;
}

.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 8px 8px 16px #c8d0e7, -8px -8px 16px #ffffff !important;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: #e0e0e0;
    box-shadow: inset 4px 4px 8px #c8d0e7, inset -4px -4px 8px #ffffff;
    margin-bottom: 1rem;
}

/* Fade In Up Animation */
.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

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