/* Enhanced UI elements for Between The Lines */

/* Card styling */
.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s cubic-bezier(.25,.8,.25,1);
}

.card:hover {
    box-shadow: 0 14px 28px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8eaed;
}

.card-body {
    padding: 4px 0;
}

.card-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e8eaed;
    display: flex;
    justify-content: flex-end;
}

/* Form elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #5f6368;
    font-size: 14px;
}

.form-control {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #202124;
    background-color: #fff;
    border: 1px solid #dadce0;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.2);
    outline: 0;
}

/* Select with custom styling */
.custom-select {
    position: relative;
    display: inline-block;
}

.custom-select select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 32px;
    background-color: #fff;
    cursor: pointer;
}

.custom-select:after {
    content: "▼";
    font-size: 12px;
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    pointer-events: none;
    color: #5f6368;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 12px;
}

.badge-primary {
    background-color: #e8f0fe;
    color: #1a73e8;
}

.badge-secondary {
    background-color: #f1f3f4;
    color: #5f6368;
}

.badge-success {
    background-color: #e6f4ea;
    color: #0f9d58;
}

.badge-warning {
    background-color: #fef7e0;
    color: #f9ab00;
}

.badge-danger {
    background-color: #fce8e6;
    color: #d93025;
}

/* Alert box */
.alert {
    position: relative;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
}

.alert-icon {
    margin-right: 12px;
    font-size: 20px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    padding: 0;
    font-size: 20px;
}

.alert-close:hover {
    opacity: 1;
}

.alert-info {
    background-color: #e8f0fe;
    color: #1a73e8;
    border-left: 4px solid #1a73e8;
}

.alert-success {
    background-color: #e6f4ea;
    color: #0f9d58;
    border-left: 4px solid #0f9d58;
}

.alert-warning {
    background-color: #fef7e0;
    color: #f9ab00;
    border-left: 4px solid #f9ab00;
}

.alert-error {
    background-color: #fce8e6;
    color: #d93025;
    border-left: 4px solid #d93025;
}

/* Event card styles - see components.css for complete event card styling */

/* Search input */
.search-input {
    position: relative;
}

.search-input input {
    padding-left: 36px;
    height: 40px;
    border-radius: 20px;
    border: 1px solid #dadce0;
    width: 100%;
    transition: all 0.3s ease;
}

.search-input input:focus {
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.2);
    outline: none;
}

.search-input:before {
    content: "🔍";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #5f6368;
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    height: 1em;
    margin-bottom: 8px;
}

.skeleton.skeleton-text {
    width: 100%;
}

.skeleton.skeleton-title {
    width: 70%;
    height: 1.5em;
}

.skeleton.skeleton-button {
    width: 120px;
    height: 36px;
}

.skeleton.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Searchable dropdown styles */
.searchable-select {
    position: relative;
}

.select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    min-width: 150px;
    font-size: 14px;
    transition: all 0.2s;
    user-select: none;
    color: white;
}

.select-trigger:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.select-trigger:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.select-value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 8px;
}

.select-arrow {
    font-size: 20px;
    color: white;
    transition: transform 0.2s;
}

.searchable-select.open .select-arrow {
    transform: rotate(180deg);
}

/* Hide any default custom-select arrows in the ribbon */
.entity-filter-ribbon .custom-select::after {
    display: none;
}

.entity-filter-ribbon .filter-label {
    color: rgba(255, 255, 255, 0.9);
    margin-right: 8px;
}

.searchable-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    width: 350px;
    max-width: 90vw;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    max-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Adjust for ribbon location */
.entity-filter-ribbon .searchable-dropdown-menu {
    right: 0;
    left: auto;
}

.dropdown-search {
    padding: 8px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.dropdown-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.dropdown-search-input:focus {
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.1);
}

.dropdown-items {
    overflow-y: auto;
    max-height: 320px;
    padding: 4px 0;
}

.dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #202124;
    transition: background-color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-item:hover,
.dropdown-item.highlighted {
    background-color: #f1f3f4;
}

.dropdown-item:active {
    background-color: #e8eaed;
}

.dropdown-item.highlighted {
    background-color: #e3f2fd;
    outline: 2px solid #4285f4;
    outline-offset: -2px;
}

.no-results-message {
    padding: 16px;
    text-align: center;
    color: #5f6368;
    font-style: italic;
}

/* Hide drag handle on desktop */
.dropdown-drag-handle {
    display: none;
}

/* Enhanced tabs styling */
.tabs-container {
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    background-color: #f1f3f5;
}

.tab-button {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    transition: all 0.2s ease;
    position: relative;
}

.tab-button:hover {
    background-color: #e9ecef;
    color: #007bff;
}

.tab-button.active {
    border-bottom: 3px solid #007bff;
    color: #007bff;
    background-color: #fff;
    font-weight: 600;
}

.tab-button.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #007bff, #0056b3);
}

.tab-pane {
    display: none;
    padding: 20px;
    background-color: #fff;
}

.tab-pane.active {
    display: block;
}

/* Event image styling */
#preAnalyzedEventImage,
#analysisEventImage {
    width: 100%;
    height: 180px;
    object-fit: cover;
    margin: 0 auto 20px auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Pre-analyzed event card */
#preAnalyzedEventContainer .card {
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

#preAnalyzedEventContainer .card-header {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
}

#preAnalyzedEventInfo {
    margin: 15px 0;
    font-size: 15px;
}

/* Source articles styling in tabs */
#articles-tab .articles-table {
    width: 100%;
    border-collapse: collapse;
}

#articles-tab .articles-table th,
#articles-tab .articles-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

#articles-tab .articles-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

#articles-tab .article-link {
    display: inline-block;
    padding: 6px 12px;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
}

#articles-tab .article-link:hover {
    background-color: #0069d9;
}

/* Responsive table container for horizontal scroll */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Ensure tables inside are not cut off */
.table-responsive table {
    min-width: 600px;
    width: max-content;
    max-width: none;
}

/* Make table cells wrap and set a max width */
.analysis-table td, .analysis-table th, .articles-table td, .articles-table th {
    max-width: 150px;
    white-space: normal;
    word-break: break-word;
}

/* Mobile responsive fixes for articles tab */
@media (max-width: 768px) {
    #articles-tab .articles-table {
        width: 100% !important;
        min-width: 100% !important;
    }
    
    #articles-tab .articles-table th,
    #articles-tab .articles-table td {
        padding: 8px 6px !important;
        font-size: 13px !important;
        word-break: break-word;
        overflow-wrap: break-word;
        max-width: none !important; /* Remove max-width constraint */
    }
    
    #articles-tab .article-link {
        padding: 3px 8px !important;
        font-size: 11px !important;
        border-radius: 12px !important;
    }
}

@media (max-width: 480px) {
    #articles-tab .articles-table th,
    #articles-tab .articles-table td {
        padding: 6px 4px !important;
        font-size: 12px !important;
        line-height: 1.3;
    }
    
    #articles-tab .article-link {
        padding: 2px 6px !important;
        font-size: 10px !important;
    }
}

.events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.events-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #2c3e50;
}

.controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: nowrap;
}

.controls select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #ffffff;
    color: #374151;
    font-size: 14px;
    line-height: 1.5;
    height: 38px;
    min-width: 180px;
    cursor: pointer;
    transition: all 0.2s ease;
    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 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    flex-shrink: 0;
}

.controls select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.controls select:hover {
    border-color: #9ca3af;
}

/* Enhanced toggle button styles with higher specificity */
.controls .toggle-btn {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    height: 38px !important;
}

.controls .toggle-btn label {
    position: relative !important;
    display: inline-block !important;
    width: 44px !important;
    height: 22px !important;
    cursor: pointer !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.controls .toggle-btn input {
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
}

.controls .toggle-slider {
    position: absolute !important;
    cursor: pointer !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-color: #cbd5e1 !important;
    transition: all .3s ease !important;
    border-radius: 22px !important;
    border: none !important;
}

.controls .toggle-slider:before {
    position: absolute !important;
    content: "" !important;
    height: 18px !important;
    width: 18px !important;
    left: 2px !important;
    top: 2px !important;
    background-color: white !important;
    transition: all .3s ease !important;
    border-radius: 50% !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
}

.controls input:checked + .toggle-slider {
    background-color: #3b82f6 !important;
}

.controls input:checked + .toggle-slider:before {
    transform: translateX(22px) !important;
}

.controls .toggle-text {
    font-size: 14px !important;
    color: #374151 !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    user-select: none !important;
    flex-shrink: 0 !important;
    min-width: fit-content !important;
}

/* Language Selector */
.language-selector {
    margin-left: 15px;
    display: flex;
    align-items: center;
}

.language-selector .custom-select {
    min-width: 50px;
    max-width: 50px;
    position: relative;
}

.language-selector select {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 16px 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    width: 100%;
    text-align: center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.language-selector select:focus {
    border-color: rgba(255, 255, 255, 0.5);
    outline: none;
}

.language-selector .custom-select:after {
    content: "▼";
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    pointer-events: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
}

/* Filter-specific styling to ensure proper display */
.filters-row .form-control {
    display: inline-block;
    width: auto;
    min-width: 120px;
    max-width: 200px; /* Limit maximum width */
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #202124;
    background-color: #fff;
    border: 1px solid #dadce0;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    vertical-align: middle;
}

.filters-row .form-control:focus {
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.2);
    outline: 0;
}

/* Search mode specific styling (don't constrain width as much) */
#searchView .filters-row .form-control {
    min-width: 150px;
    max-width: none; /* Allow search inputs to be wider */
}

#searchView .filters-row .custom-select {
    min-width: 150px;
    max-width: none;
}

/* Recent events specific styling (constrain width more) */
#recentEventsContainer .filters-row .filter-item {
    display: flex;
    flex-direction: row; /* Side by side layout */
    align-items: center;
    gap: 6px; /* Space between label and selector */
    margin-right: 15px;
    margin-bottom: 6px;
    white-space: nowrap;
}

#recentEventsContainer .filters-row .filter-label {
    font-weight: 500;
    font-size: 13px;
    color: #5f6368;
    margin-bottom: 0; /* No bottom margin needed for row layout */
    flex-shrink: 0;
    min-width: fit-content; /* Size to content */
}

#recentEventsContainer .filters-row .custom-select {
    position: relative;
    display: inline-block;
    min-width: 100px; /* Smaller since content is short */
    max-width: 140px; /* Smaller max width */
    flex: 1; /* Take remaining space */
}

#recentEventsContainer .filters-row .custom-select select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    padding: 8px 32px 8px 12px !important;
    background-color: #fff !important;
    background-image: none !important;
    cursor: pointer !important;
    width: 100% !important;
    border: 1px solid #dadce0 !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #202124 !important;
    font-weight: normal !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
    box-shadow: none !important;
}

#recentEventsContainer .filters-row .custom-select select:hover {
    border-color: #9ca3af !important;
    box-shadow: none !important;
    background-color: #fff !important;
}

#recentEventsContainer .filters-row .custom-select select:focus {
    border-color: #4285f4 !important;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.2) !important;
    outline: none !important;
    background-color: #fff !important;
}

#recentEventsContainer .filters-row .custom-select:after {
    content: "▼" !important;
    font-size: 12px !important;
    position: absolute !important;
    top: 50% !important;
    right: 12px !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
    color: #5f6368 !important;
    font-weight: normal !important;
}

/* Specific styling for individual dropdowns */
#recentEventsLanguage,
#entityFilter, 
#sortEvents {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-color: #fff !important;
    border: 1px solid #dadce0 !important;
    border-radius: 4px !important;
    padding: 8px 32px 8px 12px !important;
    font-size: 14px !important;
    font-weight: normal !important;
    color: #202124 !important;
    cursor: pointer !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
    box-shadow: none !important;
    min-width: 140px !important;
    max-width: 180px !important;
}

#recentEventsLanguage:hover,
#entityFilter:hover,
#sortEvents:hover {
    border-color: #9ca3af !important;
    box-shadow: none !important;
    background-color: #fff !important;
}

#recentEventsLanguage:focus,
#entityFilter:focus,
#sortEvents:focus {
    border-color: #4285f4 !important;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.2) !important;
    outline: none !important;
    background-color: #fff !important;
}

/* Mobile responsive fixes for filters */
@media (max-width: 768px) {
    .events-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px; /* Reduced gap */
        margin-bottom: 12px; /* Reduced margin */
    }
    
    .events-header h2 {
        font-size: 1.3rem; /* Smaller title */
        margin: 0;
    }
    
    .controls {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px; /* Much smaller gap */
        align-items: center;
        justify-content: flex-start;
    }
    
    .controls select {
        padding: 6px 20px 6px 8px; /* Much smaller padding */
        font-size: 12px; /* Smaller font */
        min-width: 90px; /* Much smaller width */
        max-width: 120px; /* Smaller max width */
        height: 32px; /* Fixed smaller height */
        background-size: 12px; /* Smaller arrow */
        background-position: right 6px center; /* Closer arrow */
    }
    
    .controls .toggle-btn {
        height: 32px !important; /* Match select height */
        gap: 6px !important; /* Smaller gap */
    }
    
    .controls .toggle-btn label {
        width: 36px !important; /* Smaller toggle */
        height: 18px !important; /* Smaller toggle */
    }
    
    .controls .toggle-slider {
        border-radius: 18px !important;
    }
    
    .controls .toggle-slider:before {
        height: 14px !important; /* Smaller circle */
        width: 14px !important; /* Smaller circle */
        left: 2px !important;
        top: 2px !important;
    }
    
    .controls input:checked + .toggle-slider:before {
        transform: translateX(18px) !important; /* Adjust for smaller toggle */
    }
    
    .controls .toggle-text {
        font-size: 12px !important; /* Smaller text */
    }
    
    /* Make recent events filter items more compact */
    #recentEventsContainer .filters-row .filter-item {
        flex-direction: row !important; /* Keep row layout on mobile */
        align-items: center !important; /* Center alignment */
        gap: 4px !important; /* Small gap between label and select */
        margin-right: 0 !important; /* No right margin needed */
        margin-bottom: 6px !important; /* Bottom margin */
        width: auto !important; /* Auto width */
        max-width: calc(50% - 6px) !important; /* Two items per row with gap */
        flex: 1 1 0 !important; /* Equal width distribution */
    }
    
    #recentEventsContainer .filters-row .filter-label {
        font-size: 11px !important; /* Smaller label */
        margin-bottom: 0 !important; /* No bottom margin for row layout */
        width: auto !important; /* Auto width */
        min-width: fit-content !important; /* Size to content */
        flex-shrink: 0 !important; /* Don't shrink */
        line-height: 1.2 !important; /* Tighter line height */
    }
    
    #recentEventsContainer .filters-row .custom-select {
        min-width: 80px !important; /* Minimum width for touch targets */
        max-width: 120px !important; /* Maximum width to save space */
        flex: 1 !important; /* Take remaining space */
    }
    
    #recentEventsContainer .filters-row .custom-select select {
        padding: 4px 18px 4px 6px !important; /* Reduced padding */
        font-size: 11px !important; /* Smaller font */
        height: 28px !important; /* Reduced height */
        width: 100% !important; /* Full width */
        max-width: 100% !important; /* Ensure it doesn't overflow */
        box-sizing: border-box !important; /* Include padding in width */
        line-height: 1.2 !important; /* Tighter line height */
    }
    
    #recentEventsContainer .filters-row .custom-select:after {
        font-size: 10px !important; /* Smaller arrow */
        right: 6px !important; /* Closer to edge */
    }
    
    #recentEventsLanguage,
    #entityFilter, 
    #sortEvents {
        padding: 4px 20px 4px 8px !important; /* Much smaller */
        font-size: 12px !important; /* Smaller font */
        min-width: 90px !important; /* Much smaller */
        max-width: 120px !important; /* Much smaller */
        height: 28px !important; /* Reduced height */
    }
}

@media (max-width: 480px) {
    .events-header {
        gap: 6px;
        margin-bottom: 10px;
    }
    
    .events-header h2 {
        font-size: 1.2rem; /* Even smaller title */
    }
    
    .controls {
        gap: 4px; /* Even smaller gap */
    }
    
    .controls select {
        padding: 4px 16px 4px 6px; /* Even smaller */
        font-size: 11px; /* Even smaller font */
        min-width: 80px; /* Even smaller */
        max-width: 100px; /* Even smaller */
        height: 28px; /* Even smaller height */
        background-size: 10px; /* Even smaller arrow */
        background-position: right 4px center;
    }
    
    .controls .toggle-btn {
        height: 28px !important;
        gap: 4px !important;
    }
    
    .controls .toggle-btn label {
        width: 32px !important;
        height: 16px !important;
    }
    
    .controls .toggle-slider:before {
        height: 12px !important;
        width: 12px !important;
    }
    
    .controls input:checked + .toggle-slider:before {
        transform: translateX(16px) !important;
    }
    
    .controls .toggle-text {
        font-size: 11px !important;
    }
    
    /* Even more compact recent events filters */
    #recentEventsContainer .filters-row .filter-item {
        flex-direction: row !important; /* Keep row layout even on small screens */
        align-items: center !important; /* Center alignment */
        max-width: calc(50% - 4px) !important; /* Half width for side-by-side */
        margin-right: 0 !important; /* No right margin needed */
        margin-bottom: 4px !important; /* Reduced bottom margin */
        width: auto !important; /* Auto width */
        gap: 3px !important; /* Small gap between label and select */
        flex: 1 1 0 !important; /* Equal width distribution */
    }
    
    #recentEventsContainer .filters-row .filter-label {
        font-size: 10px !important; /* Even smaller */
        margin-bottom: 0 !important; /* No bottom margin for row layout */
        width: auto !important; /* Auto width */
        min-width: fit-content !important; /* Size to content */
        flex-shrink: 0 !important; /* Don't shrink */
        line-height: 1.1 !important; /* Even tighter line height */
    }
    
    #recentEventsContainer .filters-row .custom-select {
        min-width: 70px !important; /* Minimum for very small screens */
        max-width: 100px !important; /* Maximum to save space */
        flex: 1 !important; /* Take remaining space */
    }
    
    #recentEventsContainer .filters-row .custom-select select {
        padding: 3px 14px 3px 5px !important; /* Even smaller padding */
        font-size: 10px !important; /* Even smaller font */
        height: 24px !important; /* Even smaller height */
        width: 100% !important; /* Full width */
        max-width: 100% !important; /* Ensure no overflow */
        box-sizing: border-box !important; /* Include padding in width */
        line-height: 1.1 !important; /* Tighter line height */
    }
    
    #recentEventsContainer .filters-row .custom-select:after {
        font-size: 8px !important;
        right: 4px !important;
    }
    
    #recentEventsLanguage,
    #entityFilter, 
    #sortEvents {
        padding: 3px 16px 3px 6px !important;
        font-size: 11px !important;
        min-width: 80px !important;
        max-width: 100px !important;
        height: 24px !important;
    }
} 