/* In app.css */
:root {
    /* Color palette */
    --primary: #336699;
    --primary-dark: #003366;
    --primary-light: #6699CC;
    --secondary: #FF9933;
    --text: #212529;
    --text-light: #6c757d;
    --border-color: #e2e8f0;
    --border-light: rgba(51, 102, 153, 0.1);
    
    /* Component colors */
    --hover-light: rgba(51, 102, 153, 0.08);
    
    /* Header specific variables */
    --header-bg: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    --header-text: #ffffff;
    --header-subtitle: rgba(255, 255, 255, 0.8);
    
    /* Search specific variables */
    --search-primary: #1a73e8;
    --search-primary-hover: #1967d2;
    --search-text: #202124;
    --search-light-text: #5f6368;
    --search-url: #006621;
    --search-highlight: rgba(58, 123, 213, 0.15);
    --search-border: var(--bs-border-color);
    --search-shadow: 0 2px 5px rgba(0,0,0,0.05);
    --search-shadow-hover: 0 1px 6px rgba(32,33,36,0.28);
    --search-bg: var(--bs-body-bg);
    --chat-btn-bg: #f0f7ff;
    --chat-btn-border: #cce5ff;
    --chat-btn-text: #0066cc;
    
    /* Common UI elements */
    --border-radius-sm: 0.5rem;
    --border-radius-md: 1rem;
    --border-radius-lg: 1.5rem;
    --border-radius-pill: 50px;
    
    /* Spacing and shadows */
    --shadow-light: 0 2px 8px rgba(0, 51, 102, 0.05);
    --shadow-medium: 0 4px 12px rgba(0, 51, 102, 0.1);
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --dropdown-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --header-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    
    /* Animation timing */
    --transition: all 0.2s ease;
    --transition-medium: all 0.3s ease;
    
    /* Layout measurements */
    --navbar-height: 56px;
    --header-height: 120px;
    --container-max-width: 1200px;

    /* Z-index hierarchy */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal: 1040;
    --z-popover: 1050;
    --z-tooltip: 1060;
}


/* Base elements */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden; /* Prevent scrolling on body */
    background-color: var(--bg-light);
    color: var(--text);
    font-family: 'Figtree', system-ui, sans-serif; /* Use a modern font */
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 0; /* Remove top padding, handled by main-content */
    padding-bottom: 0; /* Remove bottom padding, handled by main-content */
}

/* Layout components */
.full-viewport-height {
    display: flex;
    flex-direction: column;
    height: 100vh; /* Ensure it takes the full height */
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    overflow: hidden; /* Prevent scrolling on the main container */
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: calc(var(--navbar-height) + var(--header-height));
    padding-bottom: 60px; /* Ensure this is sufficient */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.main-content > * {
    width: 100%;
    max-width: var(--container-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.main-content.full-width > * {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

/* Navbar */
.navbar {
    position: fixed; /* Keep navbar fixed */
    top: 0;
    width: 100%;
    z-index: var(--z-fixed); /* Ensure navbar is above other fixed elements */
    background-color: white; /* Ensure it has a background */
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease;
    will-change: transform;
}

.navbar-dark {
    background: var(--primary);
}

/* Hide header and nav on scroll down */
.header-scroll-down .app-header {
    transform: translateY(-100%);
    opacity: 0;
}

.header-scroll-down .navbar {
    transform: translateY(-100%);
}

/* Common form elements */
.btn-primary {
    background: var(--primary);
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.card {
    background-color: white;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    transition: var(--transition);
    border: none;
}

.card-header {
    background: var(--primary-gradient);
    color: white;
    font-weight: 500;
    padding: 1rem 1.5rem;
    border: none;
}

.card:hover {
    transform: translateY(-5px); /* Lift effect on hover */
}

.input, .form-control {
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.input:focus, .form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.1);
    outline: none;
}

.dropdown-menu {
    border: none;
    box-shadow: var(--dropdown-shadow);
    border-radius: var(--border-radius-sm);
    animation: fadeIn 0.2s ease-out forwards;
}

.dropdown-item {
    transition: var(--transition);
    border-radius: var(--border-radius-sm);
    margin: 0.25rem;
}

.dropdown-item:hover {
    background-color: var(--hover-light);
    color: var(--primary);
}

/* App Header - Consistent across all pages */
.app-header {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    width: 100%;
    z-index: var(--z-sticky);
    background: var(--header-bg);
    box-shadow: var(--header-shadow);
    padding: 1rem 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    will-change: transform;
}

footer.site-footer { /* Target the specific footer component */
    position: fixed; /* Fix the footer */
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1020; /* Below navbar but above content */
    background-color: #ffffff; /* Explicit white background */
    border-top: 1px solid var(--border-light); /* Subtle top border */
    box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.05); /* Softer shadow */
    padding: 0; /* Remove default padding, handled by container */
    margin-top: 0; /* Remove margin */
}

/* Ensure footer container matches main content width */
footer.site-footer .container {
    max-width: var(--container-max-width);
    padding-left: 15px; /* Match potential main content padding */
    padding-right: 15px; /* Match potential main content padding */
}

.footer-links ul {
    gap: 0.5rem; /* Add gap between wrapped link items */
}

.footer-links a {
    color: var(--text-light); /* Use lighter text color for links */
    text-decoration: none;
    font-size: 0.875rem; /* Slightly smaller font size */
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--primary); /* Use primary color on hover */
    text-decoration: underline;
}

/* Header content */
.header-content {
    position: relative;
    text-align: center;
    z-index: 1;
    padding: 0.5rem;
}

.header-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--header-text);
    letter-spacing: -0.01em;
}

.header-subtitle {
    margin-top: 0.25rem;
    color: var(--header-subtitle);
    font-size: 1rem;
    font-weight: 400;
}

/* Header Pattern */
.header-pattern {
    position: absolute;
    inset: -50%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.2) 5%, transparent 6%),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.2) 5%, transparent 6%);
    background-size: 40px 40px;
    opacity: 0.1;
    z-index: 1;
}

@keyframes headerPattern {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive framework */
@media (max-width: 768px) {
    :root {
        --header-height: 80px;
    }

    .app-header {
        padding: 0.75rem 0;
    }
    .header-title {
        font-size: 1.5rem;
    }
    .header-subtitle {
        font-size: 0.9rem;
    }
    .main-content {
        padding-top: calc(var(--navbar-height) + 80px);
        padding-bottom: 70px; /* Slightly more padding might be needed if links wrap */
    }
    
    .main-content > * {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    footer.site-footer .py-3 {
        padding-top: 0.75rem !important; /* Reduce padding on small screens */
        padding-bottom: 0.75rem !important;
    }

    .footer-links ul {
        justify-content: center !important; /* Ensure center alignment */
    }
}

@media (max-width: 480px) {
    :root {
        --header-height: 70px;
    }
    .app-header {
        padding: 0.5rem 0;
    }
    .header-title {
        font-size: 1.25rem;
    }
    .header-subtitle {
        font-size: 0.85rem;
    }
    .main-content {
        padding-top: calc(var(--navbar-height) + var(--header-height)); /* Adjust padding for smaller screens */
    }
}

/* Add to app.css - Common UI Components */

/* Common pill/badge styling */
.pill-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: rgba(0, 51, 102, 0.03);
    color: var(--primary);
    border-radius: var(--border-radius-pill);
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    margin-right: 0.5rem;
}

.pill-badge:hover {
    background: var(--hover-light);
    color: var(--primary-dark);
    text-decoration: none;
    transform: translateY(-1px);
    border-color: rgba(51, 102, 153, 0.2);
}

.pill-badge svg {
    color: var(--primary);
}

/* Main scrollable area */
.scrollable-area {
    flex: 1; /* Ensure it fills the content-container */
    padding: 1rem 1.5rem;
    background: linear-gradient(180deg, var(--bg-off-white) 0%, #fff 100%);
    -webkit-overflow-scrolling: touch;
}

/* Input footer area */
.input-footer {
    left: 0;
    width: 100%;
    background: white;
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0)); /* Adjust padding for safe area */
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

/* Improved input form layout */
.input-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    max-width: 100%;
}

.input-form .form-control {
    flex: 1;
    min-width: 0;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1rem 1.5rem;
    font-size: 1rem;
    transition: var(--transition-medium);
    background: var(--bs-white);
}

.input-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(51, 102, 153, 0.1);
}

.input-form .btn-primary {
    background: var(--primary);
    border-radius: var(--border-radius-lg);
    padding: 1rem 2rem;
    font-weight: 600;
    border: none;
    transition: var(--transition-medium);
}

.input-form .btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.2);
}

/* Loading indicator */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    gap: 0.5rem;
    min-height: 60px; /* Ensure consistent minimum height */
}

.spinner-grow {
    background: var(--primary-light);
    opacity: 0.7;
}

/* Empty state styling */
.empty-state-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
    padding: 2rem 1rem; /* Adjusted padding */
    text-align: center;
    animation: fadeIn 0.5s ease-out forwards;
}

.big-icon {
    margin-bottom: 1.5rem;
    color: var(--primary); /* Use primary color consistently */
    opacity: 0.5;
}

.empty-state-heading {
    color: var(--text);
    font-weight: 400;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

/* Message containers */
.message-bubble {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-lg);
    max-width: 90%; /* Consistent max-width */
    box-shadow: var(--shadow-light);
    margin-bottom: 1rem;
    word-break: break-word;
    position: relative; /* Needed for animations/positioning */
    opacity: 0; /* Start hidden for animation */
    transform: translateY(10px); /* Start slightly lower for animation */
    animation: messageAppear 0.3s ease-out forwards;
    will-change: transform, opacity;
}

/* Common suggestion elements */
.suggestion-base {
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    color: var(--text);
    text-align: left;
    text-decoration: none; /* Ensure no underline by default */
    display: inline-flex; /* Use flex for alignment */
    align-items: center;
    gap: 0.75rem; /* Consistent gap */
    position: relative; /* For potential pseudo-elements */
}

.suggestion-base:hover {
    border-color: rgba(51, 102, 153, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 51, 102, 0.1);
    text-decoration: none; /* Ensure no underline on hover */
    color: var(--primary-dark); /* Consistent hover text color */
    background-color: var(--hover-light); /* Consistent hover background */
}

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

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

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

/* Responsive adjustments */
@media (max-width: 768px) {
    
    .input-footer {
        padding: 0.75rem;
    }
    
    .input-form {
        gap: 0.5rem;
    }
    
    .input-form .form-control {
        padding: 0.75rem 1rem;
    }
    
    .input-form .btn-primary {
        padding: 0.75rem 1.25rem;
    }
    
    .empty-state-heading {
        font-size: 1.3rem;
    }
    
    .pill-badge {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .message-bubble {
        max-width: 95%; /* Slightly wider on smaller screens */
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    .empty-state-heading {
        font-size: 1.2rem;
    }
}

/* Add these styles at the end of your app.css file */

/* Make header and navbar containers consistent with content container width */
.navbar .container,
.app-header .container {
    max-width: var(--container-max-width); /* Match the content-container max-width */
}

/* Ensure proper padding on smaller screens */
@media (max-width: 1200px) {
    .navbar .container,
    .app-header .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Common suggestion elements - shared properties */
.suggestion-base {
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    color: var(--text);
    text-align: left;
}

.suggestion-base:hover {
    border-color: rgba(51, 102, 153, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 51, 102, 0.1);
}

/* Context specific styling */
/* For chat interface - keep the chat bubble look */
.suggestion-btn {
    /* Keep your existing chat suggestion styles but add the common class */
    background-color: white;
    border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) var(--border-radius-lg); /* AI bubble style */
    padding: 1rem 1.5rem;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    display: block;
    width: 100%;
    max-width: 70%;
    line-height: 1.6;
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.05);
}

/* For search interface - keep the pill look but align colors and interactions */
.suggestion-pill {
    background-color: rgba(102, 153, 204, 0.03);
    border-radius: var(--border-radius-pill);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--primary);
}

/* Add the hover effect arrow to search pills */
.suggestion-pill {
    position: relative;
    padding-right: 1.5rem;
}

.suggestion-pill::after {
    content: '»';
    position: absolute;
    right: 10px;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.suggestion-pill:hover::after {
    opacity: 0.6;
    transform: translateX(3px);
}

.suggestion-pill:hover {
    background-color: var(--hover-light);
    color: var(--primary-dark);
}

/* Message containers - used in both chat and AI research */
.message-bubble, .ai-answer {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-lg);
    max-width: 90%;
    box-shadow: var(--shadow-light);
    margin-bottom: 1rem;
    word-break: break-word;
}

/* Loading indicators - standard across all pages */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    gap: 8px;
}

/* Empty states - consistent across features */
.empty-state-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
    padding: 2rem 0;
    text-align: center;
}

/* Base card styles */
.card-container {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 1rem;
  margin-bottom: 1rem;
}

/* Header icon styling */
.header-title i {
    margin-right: 0.75rem;
    color: var(--header-text);
    opacity: 0.9;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.header-title:hover i {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .header-title i {
        margin-right: 0.5rem;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .header-title i {
        margin-right: 0.4rem;
        font-size: 0.85em;
    }
}

/* Model selector styling */
.model-selector .dropdown-toggle {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
}

.model-selector .dropdown-item {
    padding: 0.5rem 1rem;
    white-space: normal;
}

.model-selector .dropdown-item.active {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: inherit;
}

.model-selector .dropdown-item.active .fw-medium {
    color: var(--bs-primary);
}

.model-selector .dropdown-menu {
    width: 250px;
    padding: 0.5rem 0;
}

/* Common UI components - shared across all features */

/* Loading indicator - unified style */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    gap: 0.5rem;
    min-height: 60px; /* Ensure consistent minimum height */
}

.spinner-grow {
    background: var(--primary-light);
    opacity: 0.7;
}

/* Empty state styling - unified */
.empty-state-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
    padding: 2rem 1rem; /* Adjusted padding */
    text-align: center;
    animation: fadeIn 0.5s ease-out forwards;
}

.big-icon {
    margin-bottom: 1.5rem;
    color: var(--primary); /* Use primary color consistently */
    opacity: 0.5;
}

.empty-state-heading {
    color: var(--text);
    font-weight: 400;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

/* Message containers - base style */
.message-bubble {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-lg);
    max-width: 90%; /* Consistent max-width */
    box-shadow: var(--shadow-light);
    margin-bottom: 1rem;
    word-break: break-word;
    position: relative; /* Needed for animations/positioning */
    opacity: 0; /* Start hidden for animation */
    transform: translateY(10px); /* Start slightly lower for animation */
    animation: messageAppear 0.3s ease-out forwards;
    will-change: transform, opacity;
}

/* Common suggestion elements - base class */
.suggestion-base {
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    color: var(--text);
    text-align: left;
    text-decoration: none; /* Ensure no underline by default */
    display: inline-flex; /* Use flex for alignment */
    align-items: center;
    gap: 0.75rem; /* Consistent gap */
    position: relative; /* For potential pseudo-elements */
}

.suggestion-base:hover {
    border-color: rgba(51, 102, 153, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 51, 102, 0.1);
    text-decoration: none; /* Ensure no underline on hover */
    color: var(--primary-dark); /* Consistent hover text color */
    background-color: var(--hover-light); /* Consistent hover background */
}

/* Animation effects - unified definitions */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%); /* Keep original direction if needed */
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Responsive adjustments for common elements */
@media (max-width: 768px) {
    /* ... existing responsive styles ... */

    .empty-state-heading {
        font-size: 1.3rem;
    }

    .message-bubble {
        max-width: 95%; /* Slightly wider on smaller screens */
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    /* ... existing responsive styles ... */

    .empty-state-heading {
        font-size: 1.2rem;
    }
}

/* Form improvements */
.form-control,
.form-select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(51, 102, 153, 0.15);
}

/* Form validation states */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--bs-danger);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: var(--bs-success);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Form feedback messages */
.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--bs-danger);
}

.valid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--bs-success);
}

.was-validated .form-control:invalid ~ .invalid-feedback,
.was-validated .form-control:valid ~ .valid-feedback,
.form-control.is-invalid ~ .invalid-feedback,
.form-control.is-valid ~ .valid-feedback {
    display: block;
}

/* Add focus visible outlines for better keyboard navigation */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Content container for ultrawide screens */
@media (min-width: 2000px) {
    .main-content > * {
        max-width: min(var(--container-max-width), 65%);
    }
}

/* Print styles */
@media print {
    @page {
        margin: 2cm;
    }

    body {
        min-height: auto;
        padding: 0;
        background: none;
    }

    .navbar,
    .app-header,
    .site-footer,
    .no-print {
        display: none !important;
    }

    .main-content {
        padding: 0;
        overflow: visible;
    }

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

    .message-bubble {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #eee;
    }

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .card:hover,
    .suggestion-base:hover {
        transform: none;
    }
}

/* Logo animations */
.logo-svg {
    transition: var(--transition-medium);
    transform-origin: center;
}

.navbar-brand:hover .logo-svg {
    transform: scale(1.05) rotate(5deg);
}

.logo-text {
    transition: var(--transition);
}

.navbar-brand:hover .logo-text {
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Subtle glow effect for the logo */
.navbar-brand {
    transition: var(--transition);
    border-radius: var(--border-radius-sm);
    padding: 0.25rem 0.5rem;
}

.navbar-brand:hover {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

/* Responsive logo sizing */
@media (max-width: 768px) {
    .logo-svg {
        width: 28px;
        height: 28px;
    }
    
    .logo-text {
        font-size: 1.1rem !important;
    }
}

@media (max-width: 480px) {
    .logo-svg {
        width: 24px;
        height: 24px;
    }
    
    .logo-text {
        font-size: 1rem !important;
    }
}

