/* Box-3 Calculator Nederland - Custom Styles */

/* Base styles and fixes */
* {
    box-sizing: border-box;
}

/* Loading spinner animation */
.spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
}

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

/* Notification animations */
@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.animate-slide-in {
    animation: slide-in 0.3s ease-out;
}

/* Rate limit notification styles */
.rate-limit-notification {
    transition: all 0.3s ease-out;
}

/* Error states */
.error-message {
    background-color: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* Success states */
.success-message {
    background-color: #f0fdf4;
    border-color: #86efac;
    color: #16a34a;
}

/* Input focus states */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Custom scrollbar for better UX */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: black;
        background: white;
    }
}

/* Debug styles */
.debug-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1f2937;
    color: #f9fafb;
    padding: 12px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 12px;
    max-width: 300px;
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.debug-panel h4 {
    margin: 0 0 8px 0;
    color: #60a5fa;
}

.debug-panel ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.debug-panel li {
    padding: 2px 0;
    border-bottom: 1px solid #374151;
}

/* ================================
   MOBILE OPTIMIZATIONS & UX IMPROVEMENTS
   ================================ */

/* Minimal padding for calculation container - applies to ALL screen sizes */
.bg-white.border.rounded-lg.shadow-sm {
    padding: 0.2rem !important; /* 3.2px breathing room prevents text touching edges */
    margin: 0 !important;
}

/* Add minimal horizontal padding to child sections for better readability */
.bg-white.border.rounded-lg.shadow-sm > div {
    padding-left: 0.2rem !important;
    padding-right: 0.2rem !important;
}

/* Override px-2, px-4 classes with minimal padding */
.bg-white.border.rounded-lg.shadow-sm .px-2,
.bg-white.border.rounded-lg.shadow-sm .sm\:px-4,
.bg-white.border.rounded-lg.shadow-sm .md\:px-6 {
    padding-left: 0.2rem !important;
    padding-right: 0.2rem !important;
}

/* Mobile-first base styles */
@media (max-width: 768px) {
    /* Body and container optimizations */
    body {
        padding: 0;
        margin: 0;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    #calculator-app {
        padding: 0 !important; /* No padding for iframe display */
        max-width: 100%;
    }
    
    /* Typography improvements for mobile */
    h1 {
        font-size: 1.5rem !important; /* 24px - was too large */
        line-height: 1.3 !important;
    }
    
    h2 {
        font-size: 1.25rem !important; /* 20px */
        line-height: 1.4 !important;
    }
    
    h3 {
        font-size: 1.125rem !important; /* 18px */
        line-height: 1.4 !important;
        margin-bottom: 0.75rem !important;
    }
    
    /* Enhanced input field styles for mobile */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    select,
    textarea {
        font-size: 16px !important; /* Prevents iOS zoom */
        padding: 0.875rem !important; /* 14px - larger touch target */
        border-radius: 0.5rem !important;
        border: 2px solid #e5e7eb !important;
        min-height: 44px !important; /* iOS touch target guideline */
        -webkit-appearance: none;
        appearance: none;
    }
    
    /* Select dropdown specific */
    select {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
        background-position: right 0.75rem center;
        background-repeat: no-repeat;
        background-size: 1rem 1rem;
        padding-right: 3rem !important;
    }
    
    /* Button optimizations for mobile */
    button {
        min-height: 44px !important; /* iOS touch target */
        padding: 0.75rem 1rem !important;
        font-size: 1rem !important;
        font-weight: 500 !important;
        border-radius: 0.5rem !important;
        touch-action: manipulation; /* Prevents double-tap zoom */
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    /* Small button variants */
    .btn-sm {
        min-height: 36px !important;
        padding: 0.5rem 0.75rem !important;
        font-size: 0.875rem !important;
    }
    
    /* Card and section improvements */
    .bg-white:not(.border),
    [class*="bg-"]:not(.bg-gray):not(.bg-transparent):not(.border) {
        margin-bottom: 1rem !important;
        padding: 1rem !important; /* Reduced from 1.5rem for mobile */
        border-radius: 0.75rem !important; /* Slightly larger radius */
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important; /* Subtle shadow */
    }
    
    /* Grid system optimizations */
    .grid {
        gap: 0.75rem !important; /* Reduced gap for mobile */
    }
    
    /* Force single column on mobile for complex grids */
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4,
    .md\\:grid-cols-2,
    .md\\:grid-cols-3,
    .md\\:grid-cols-4 {
        grid-template-columns: 1fr !important;
    }
    
    /* Collapsible section headers - larger touch targets */
    .collapsible-header {
        padding: 1rem !important; /* Larger touch area */
        min-height: 56px !important;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.05);
    }
    
    /* Navigation and interaction improvements */
    .cursor-pointer:hover {
        background-color: rgba(0, 0, 0, 0.02) !important;
    }
    
    /* Spacing improvements */
    .space-y-4 > *:not(:last-child) {
        margin-bottom: 1rem !important; /* Consistent spacing */
    }
    
    .space-y-6 > *:not(:last-child) {
        margin-bottom: 1.25rem !important;
    }
    
    /* Text size adjustments */
    .text-xs {
        font-size: 0.8125rem !important; /* Slightly larger than 12px */
        line-height: 1.4 !important;
    }
    
    .text-sm {
        font-size: 0.9375rem !important; /* 15px - more readable */
        line-height: 1.5 !important;
    }
    
    /* Notification adjustments for mobile */
    .rate-limit-notification {
        left: 0.75rem !important;
        right: 0.75rem !important;
        top: 1rem !important;
        max-width: none !important;
    }
    
    /* Debug panel mobile adjustments */
    .debug-panel {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 11px !important;
        padding: 0.75rem !important;
    }
    
    /* Form-specific mobile improvements */
    .form-row {
        display: flex;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    /* Labels - better spacing and sizing */
    label {
        font-size: 0.9375rem !important; /* 15px */
        font-weight: 500 !important;
        margin-bottom: 0.375rem !important;
        color: #374151 !important;
    }
    
    /* Helper text - improved readability */
    .text-gray-500,
    .text-gray-600 {
        font-size: 0.8125rem !important; /* 13px */
        line-height: 1.5 !important;
        margin-top: 0.25rem !important;
    }
    
    /* Loading states - mobile friendly */
    .animate-spin {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
    
    /* Results section mobile optimizations */
    #results {
        margin-top: 1.5rem !important;
    }
    
    /* Table responsiveness */
    table {
        font-size: 0.875rem !important;
    }
    
    th, td {
        padding: 0.5rem !important;
    }
}

/* Ultra small screens (phones in portrait) */
@media (max-width: 480px) {
    #calculator-app {
        padding: 0 !important; /* No padding for iframe display */
    }
    
    h1 {
        font-size: 1.375rem !important; /* 22px */
    }
    
    .bg-white:not(.border),
    [class*="bg-"]:not(.bg-gray):not(.bg-transparent):not(.border) {
        padding: 0.875rem !important; /* Even more compact */
        margin-bottom: 0.875rem !important;
    }
    
    input[type="text"],
    input[type="number"],
    input[type="email"],
    select,
    textarea {
        padding: 0.75rem !important;
        font-size: 16px !important; /* Keep to prevent zoom */
    }
    
    button {
        padding: 0.625rem 0.875rem !important;
        font-size: 0.9375rem !important;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .space-y-4 > *:not(:last-child) {
        margin-bottom: 0.75rem !important;
    }
    
    .space-y-6 > *:not(:last-child) {
        margin-bottom: 1rem !important;
    }
    
    .bg-white:not(.border),
    [class*="bg-"]:not(.bg-gray):not(.bg-transparent):not(.border) {
        padding: 0.75rem !important;
        margin-bottom: 0.75rem !important;
    }
}

/* Touch-specific enhancements */
@media (hover: none) and (pointer: coarse) {
    /* This targets touch devices specifically */
    
    button:active,
    .cursor-pointer:active {
        transform: translateY(1px);
        background-color: rgba(0, 0, 0, 0.05) !important;
    }
    
    input:focus,
    select:focus,
    textarea:focus {
        border-color: #3b82f6 !important;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
    }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2) and (max-width: 768px) {
    /* Sharper borders on retina displays */
    input,
    select,
    button {
        border-width: 1px !important;
    }
}

/* ================================
   MOBILE-SPECIFIC COMPONENT OPTIMIZATIONS
   ================================ */

/* Mobile calculator app specific styles */
.mobile-interface {
    --mobile-spacing: 0.75rem;
    --mobile-padding: 0.875rem;
    --mobile-border-radius: 0.75rem;
}

@media (max-width: 768px) {
    /* Dashboard header optimizations */
    .bg-gradient-to-r {
        padding: 1rem !important;
        border-radius: var(--mobile-border-radius) !important;
    }
    
    /* Collapsible sections mobile improvements */
    .collapsible-section {
        border-radius: var(--mobile-border-radius) !important;
        margin-bottom: 1rem !important;
        overflow: hidden;
    }
    
    .collapsible-header {
        padding: 1rem !important;
        min-height: 56px !important;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
        transition: background-color 0.15s ease;
    }
    
    .collapsible-header:active {
        background-color: rgba(0, 0, 0, 0.05) !important;
    }
    
    .collapsible-content {
        padding: 0 1rem 1rem 1rem !important;
    }
    
    /* Preview text in headers */
    .preview-text {
        font-size: 0.8125rem !important; /* 13px */
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: none; /* Hidden on mobile - too long and unnecessary */
    }
    
    /* Show preview text only on desktop */
    @media (min-width: 768px) {
        .preview-text {
            display: inline;
        }
    }
    
    /* Chevron icons in collapsible headers */
    .chevron {
        flex-shrink: 0;
        width: 1.25rem !important;
        height: 1.25rem !important;
    }
    
    /* Form sections with colored backgrounds */
    .bg-green-50,
    .bg-blue-50,
    .bg-yellow-50,
    .bg-red-50,
    .bg-purple-50 {
        border-radius: var(--mobile-border-radius) !important;
        padding: var(--mobile-padding) !important;
        margin-bottom: var(--mobile-spacing) !important;
    }
    
    /* Input group styling */
    .input-group {
        margin-bottom: 1rem !important;
    }
    
    .input-group:last-child {
        margin-bottom: 0 !important;
    }
    
    /* Add/remove buttons */
    .add-button,
    .remove-button {
        min-height: 40px !important;
        padding: 0.625rem 0.875rem !important;
        font-size: 0.875rem !important;
        border-radius: 0.5rem !important;
    }
    
    /* Icon + text combinations */
    .flex.items-center svg {
        flex-shrink: 0;
        margin-right: 0.5rem !important;
    }
    
    /* Tables and list items */
    .table-header,
    .list-item {
        padding: 0.75rem !important;
        border-radius: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Grid system overrides for complex layouts */
    .grid-cols-12 {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }
    
    .grid-cols-12 > * {
        margin-bottom: 0.5rem !important;
    }
    
    .grid-cols-12 > *:last-child {
        margin-bottom: 0 !important;
    }
    
    /* Results section mobile optimizations */
    #results .bg-white:not(.border) {
        padding: 1rem !important;
        border-radius: var(--mobile-border-radius) !important;
    }
    
    /* Loading states */
    #loading {
        padding: 1.5rem 1rem !important;
        text-align: center;
        border-radius: var(--mobile-border-radius) !important;
    }
    
    /* Utility classes for mobile */
    .mobile-stack {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .mobile-center {
        text-align: center !important;
    }
    
    .mobile-full-width {
        width: 100% !important;
    }
    
    /* Step indicators mobile optimization */
    .step-indicator {
        font-size: 0.875rem !important;
        padding: 0.5rem !important;
        border-radius: 50% !important;
        min-width: 2rem !important;
        min-height: 2rem !important;
    }
    
    /* Tooltip and helper text improvements */
    .tooltip,
    [title] {
        position: relative;
    }
    
    /* Better spacing for info icons */
    .text-blue-600[title] {
        margin-left: 0.25rem !important;
        font-size: 1rem !important;
        cursor: help;
    }
}

/* Animation improvements for mobile */
@media (max-width: 768px) and (prefers-reduced-motion: no-preference) {
    .collapsible-header {
        transition: background-color 0.2s ease, transform 0.1s ease;
    }
    
    .collapsible-header:active {
        transform: scale(0.99);
    }
    
    button:active {
        transform: scale(0.98) !important;
        transition: transform 0.1s ease;
    }
}

/* ================================
   MOBILE CATEGORY HEADER UX IMPROVEMENTS  
   ================================ */

@media (max-width: 768px) {
    /* Collapsible section headers - enhanced for mobile */
    .collapsible-header {
        padding: 1.25rem !important; /* More padding for better touch */
        min-height: 64px !important; /* Increased from 56px */
        border-radius: 0.75rem !important;
        transition: all 0.2s ease !important;
        -webkit-tap-highlight-color: transparent !important;
    }
    
    .collapsible-header:active {
        background-color: rgba(59, 130, 246, 0.1) !important;
        transform: scale(0.995) !important;
    }
    
    /* Title section improvements */
    .collapsible-header .flex.items-center:first-child {
        flex: 1 !important;
        margin-right: 1rem !important;
    }
    
    /* Category title styling */
    .collapsible-header .font-medium {
        font-size: 1.125rem !important; /* 18px - larger title */
        font-weight: 600 !important;
        line-height: 1.3 !important;
        color: #1f2937 !important;
    }
    
    /* Icon improvements */
    .collapsible-header svg {
        width: 1.5rem !important; /* 24px - bigger icon */
        height: 1.5rem !important;
        margin-right: 0.75rem !important;
        flex-shrink: 0 !important;
    }
    
    /* Preview text mobile improvements */
    .preview-text {
        font-size: 0.9375rem !important; /* 15px - larger preview */
        font-weight: 500 !important;
        color: #4b5563 !important;
        max-width: 140px !important; /* Slightly more room */
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        line-height: 1.4 !important;
        margin-right: 0.75rem !important;
    }
    
    /* Chevron icon - make it bigger and more prominent */
    .chevron {
        width: 1.5rem !important; /* 24px - bigger chevron */
        height: 1.5rem !important;
        color: #6b7280 !important;
        flex-shrink: 0 !important;
        transition: transform 0.2s ease !important;
    }
    
    /* Active/expanded state styling */
    .collapsible-section.expanded .collapsible-header {
        background-color: #f3f4f6 !important;
        border-bottom: 2px solid #e5e7eb !important;
    }
    
    .collapsible-section.expanded .chevron {
        transform: rotate(180deg) !important;
        color: #3b82f6 !important;
    }
    
    /* Right side container with preview and chevron */
    .collapsible-header .flex.items-center:last-child {
        display: flex !important;
        align-items: center !important;
        flex-shrink: 0 !important;
        gap: 0.5rem !important;
    }
    
    /* Mobile-specific layout improvements */
    .collapsible-header > div {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    
    /* Category-specific color enhancements */
    .collapsible-header[onclick*="crypto"] {
        border-left: 4px solid #f59e0b !important;
    }
    
    .collapsible-header[onclick*="edelmetalen"] {
        border-left: 4px solid #eab308 !important;
    }
    
    .collapsible-header[onclick*="aandelen_etfs"] {
        border-left: 4px solid #10b981 !important;
    }
    
    .collapsible-header[onclick*="vastgoed"] {
        border-left: 4px solid #ef4444 !important;
    }
    
    .collapsible-header[onclick*="waardevolle"] {
        border-left: 4px solid #8b5cf6 !important;
    }
    
    .collapsible-header[onclick*="vorderingen"] {
        border-left: 4px solid #6366f1 !important;
    }
    
    .collapsible-header[onclick*="groen"] {
        border-left: 4px solid #059669 !important;
    }
    
    /* Hover effects for touch devices */
    .collapsible-header:hover {
        background-color: rgba(0, 0, 0, 0.03) !important;
    }
    
    /* Status indicators for mobile */
    .collapsible-header::after {
        content: "";
        position: absolute;
        right: 4rem;
        top: 50%;
        transform: translateY(-50%);
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: #d1d5db;
        transition: background-color 0.2s ease;
    }
    
    .collapsible-section.expanded .collapsible-header::after {
        background-color: #3b82f6;
    }
    
    .collapsible-section.has-content .collapsible-header::after {
        background-color: #10b981;
    }
}

/* Ultra small screens - further header optimizations */
@media (max-width: 480px) {
    .collapsible-header {
        padding: 1rem !important;
    }
    
    .collapsible-header .font-medium {
        font-size: 1rem !important; /* Slightly smaller on very small screens */
    }
    
    .preview-text {
        font-size: 0.875rem !important;
        max-width: 100px !important; /* Less room on tiny screens */
    }
}

/* ================================
   MOBILE ITEM MANAGEMENT UX IMPROVEMENTS
   ================================ */

@media (max-width: 768px) {
    /* Transform complex grid layouts into mobile-friendly cards */
    .grid-cols-12 {
        display: block !important;
        background: #f9fafb !important;
        border: 2px solid #e5e7eb !important;
        border-radius: 0.75rem !important;
        padding: 1rem !important;
        margin-bottom: 1rem !important;
        position: relative;
    }
    
    /* Hide table headers on mobile - not needed in card layout */
    .table-header {
        display: none !important;
    }
    
    /* Mobile card layout for crypto items */
    .grid-cols-12 > div {
        margin-bottom: 0.75rem !important;
        width: 100% !important;
    }
    
    .grid-cols-12 > div:last-child {
        margin-bottom: 0 !important;
    }
    
    /* Input fields in mobile cards - full width with labels */
    .grid-cols-12 input {
        width: 100% !important;
        padding: 0.875rem !important;
        font-size: 1rem !important;
        border-radius: 0.5rem !important;
        border: 2px solid #d1d5db !important;
        min-height: 44px !important;
        margin-top: 0.25rem !important;
    }
    
    .grid-cols-12 input:focus {
        border-color: #3b82f6 !important;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
    }
    
    /* Mobile labels are now handled via inline HTML labels */
    .grid-cols-12 label {
        display: block !important;
        font-size: 0.875rem !important;
        font-weight: 600 !important;
        color: #374151 !important;
        margin-bottom: 0.375rem !important;
        text-transform: uppercase !important;
        letter-spacing: 0.025em !important;
    }
    
    /* Hide mobile labels on desktop */
    @media (min-width: 769px) {
        .grid-cols-12 label.md\\:hidden {
            display: none !important;
        }
    }
    
    /* Remove button - make it prominent and easy to tap */
    .grid-cols-12 .text-center:last-child {
        position: absolute !important;
        top: 0.5rem !important;
        right: 0.5rem !important;
        margin: 0 !important;
    }
    
    .remove-crypto,
    .remove-stock,
    .remove-etf,
    .remove-bond,
    .remove-metal {
        background: #fee2e2 !important;
        border: 2px solid #fca5a5 !important;
        border-radius: 50% !important;
        width: 36px !important;
        height: 36px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: #dc2626 !important;
        transition: all 0.2s ease !important;
    }
    
    .remove-crypto:active,
    .remove-stock:active,
    .remove-etf:active,
    .remove-bond:active,
    .remove-metal:active {
        background: #fca5a5 !important;
        transform: scale(0.95) !important;
    }
    
    .remove-crypto svg,
    .remove-stock svg,
    .remove-etf svg,
    .remove-bond svg,
    .remove-metal svg {
        width: 1rem !important;
        height: 1rem !important;
    }
    
    /* Value display improvements */
    .crypto-value,
    .stock-value,
    .etf-value,
    .bond-value {
        display: block !important;
        text-align: center !important;
        background: #ecfdf5 !important;
        border: 1px solid #86efac !important;
        border-radius: 0.5rem !important;
        padding: 0.5rem !important;
        font-weight: 600 !important;
        font-size: 1rem !important;
        color: #16a34a !important;
        margin-top: 0.5rem !important;
    }
    
    .crypto-price {
        display: block !important;
        text-align: center !important;
        font-size: 0.875rem !important;
        color: #6b7280 !important;
        margin-top: 0.25rem !important;
    }
    
    /* Add buttons - make them more prominent */
    #add-crypto,
    #add-stock,
    #add-etf,
    #add-bond,
    #add-metal,
    #add-gold-coin,
    #add-silver-coin {
        width: 100% !important;
        background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
        color: white !important;
        border: none !important;
        border-radius: 0.75rem !important;
        padding: 1rem !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        min-height: 48px !important;
        margin-top: 1rem !important;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25) !important;
        transition: all 0.2s ease !important;
    }
    
    #add-crypto:active,
    #add-stock:active,
    #add-etf:active,
    #add-bond:active,
    #add-metal:active,
    #add-gold-coin:active,
    #add-silver-coin:active {
        transform: scale(0.98) !important;
        box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35) !important;
    }
    
    #add-crypto svg,
    #add-stock svg,
    #add-etf svg,
    #add-bond svg,
    #add-metal svg,
    #add-gold-coin svg,
    #add-silver-coin svg {
        width: 1.25rem !important;
        height: 1.25rem !important;
        margin-right: 0.5rem !important;
    }
    
    /* Dropdown search improvements for mobile */
    .crypto-search-dropdown,
    .etf-search-dropdown,
    .bond-search-dropdown {
        position: relative !important;
        top: 0 !important;
        margin-top: 0.5rem !important;
        border-radius: 0.5rem !important;
        border: 2px solid #e5e7eb !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
        max-height: 200px !important;
        z-index: 1000 !important;
    }
    
    .crypto-search-dropdown div,
    .etf-search-dropdown div,
    .bond-search-dropdown div {
        padding: 0.75rem !important;
        font-size: 0.875rem !important;
        border-bottom: 1px solid #e5e7eb !important;
        cursor: pointer !important;
        transition: background-color 0.15s ease !important;
    }
    
    .crypto-search-dropdown div:hover,
    .etf-search-dropdown div:hover,
    .bond-search-dropdown div:hover {
        background-color: #f3f4f6 !important;
    }
    
    .crypto-search-dropdown div:active,
    .etf-search-dropdown div:active,  
    .bond-search-dropdown div:active {
        background-color: #e5e7eb !important;
    }
    
    /* Empty state improvements */
    .text-center.py-6 {
        padding: 2rem 1rem !important;
        background: #f8fafc !important;
        border: 2px dashed #cbd5e1 !important;
        border-radius: 0.75rem !important;
        color: #64748b !important;
        font-size: 0.9375rem !important;
    }
    
    /* Card title/category indicators */
    .mobile-card-title {
        display: block !important;
        font-size: 0.875rem !important;
        font-weight: 600 !important;
        color: #374151 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.025em !important;
        margin-bottom: 0.75rem !important;
        padding-bottom: 0.5rem !important;
        border-bottom: 2px solid #e5e7eb !important;
    }
}

/* Ultra small screens - further optimizations */
@media (max-width: 480px) {
    .grid-cols-12 {
        padding: 0.75rem !important;
    }
    
    .grid-cols-12 input {
        padding: 0.75rem !important;
    }
    
    #add-crypto,
    #add-stock,
    #add-etf,
    #add-bond,
    #add-metal,
    #add-gold-coin,
    #add-silver-coin {
        padding: 0.875rem !important;
        font-size: 0.9375rem !important;
    }
}