/* Main Container */
.ret-container {
    width: 100%;
    max-width: 100%;
    margin: 1rem auto;
    padding: 0 0.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #2c3e50;
    box-sizing: border-box;
}

/* Filters Section */
.ret-filters {
    background: linear-gradient(135deg, #f8f9fa 0%, #eaecef 100%);
    padding: 1.75rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    position: relative;
    border: 1px solid rgba(0,0,0,0.03);
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.ret-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 200px;
}

.ret-filter-group.wide {
    flex-basis: 100%;
    min-width: 100%;
}

.ret-filter-group label {
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
}

.ret-filter-group input,
.ret-filter-group select {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.9rem;
    min-width: 120px;
}

/* Room and Floor buttons */
.ret-filter-label {
    font-size: 0.95rem;
    color: #343a40;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: 0.01em;
}

.ret-room-buttons,
.ret-floor-buttons {
    display: flex;
    gap: 0.5rem;
}

.ret-room-btn,
.ret-floor-btn {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 0.7rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 45px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.02);
}

.ret-room-btn:hover,
.ret-floor-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.05);
}

.ret-room-btn.active,
.ret-floor-btn.active {
    background: #4a6cf7;
    color: white;
    border-color: #4a6cf7;
    box-shadow: 0 4px 10px rgba(74, 108, 247, 0.2);
}

/* Clear filters button */
.ret-clear-filters {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    color: #495057;
    border-radius: 12px;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: absolute;
    top: 1.75rem;
    right: 1.75rem;
    opacity: 0.6;
    pointer-events: none;
}

.ret-clear-filters.active {
    opacity: 1;
    pointer-events: all;
}

.ret-clear-filters:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.ret-clear-filters svg {
    width: 16px;
    height: 16px;
}

/* Button animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ret-room-btn.pulse,
.ret-floor-btn.pulse {
    animation: pulse 0.5s ease;
}

.ret-clear-filters.rotate svg {
    animation: rotate 0.5s ease;
}

/* Area Slider */
.ret-slider-container {
    position: relative;
    height: 40px;
    width: 100%;
}

.ret-slider {
    position: absolute;
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    margin: 15px 0;
}

.ret-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0d6efd;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ret-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0d6efd;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ret-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(13, 110, 253, 0.4);
}

.ret-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(13, 110, 253, 0.4);
}

#min-area-slider {
    z-index: 2;
}

#max-area-slider {
    z-index: 1;
}

#area-range-display {
    font-weight: 600;
    color: #0d6efd;
    background: rgba(13, 110, 253, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-left: 6px;
}

/* Checkbox label */
.ret-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    user-select: none;
    padding: 10px 0;
    font-weight: 500;
    color: #343a40;
}

.ret-checkbox-label input[type="checkbox"] {
    min-width: auto;
    accent-color: #4a6cf7;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.ret-button {
    background: #0d6efd;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.25s ease;
    box-shadow: 0 2px 5px rgba(13, 110, 253, 0.3);
}

.ret-button:hover {
    background: #0b5ed7;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.4);
}

/* Table Styles */
.ret-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#apartments-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    table-layout: auto;
}

#apartments-table th,
#apartments-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .ret-container {
        padding: 0 0.25rem;
    }

    #apartments-table {
        font-size: 0.85rem;
        table-layout: fixed;
        width: 100%;
    }

    #apartments-table th,
    #apartments-table td {
        padding: 0.5rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Set specific widths for each column based on content */
    #apartments-table th:nth-child(1),
    #apartments-table td:nth-child(1) {
        width: 80px; /* Buto nr. */
    }

    #apartments-table th:nth-child(2),
    #apartments-table td:nth-child(2) {
        width: 60px; /* Aukštas */
    }

    #apartments-table th:nth-child(3),
    #apartments-table td:nth-child(3) {
        width: 80px; /* Kambarių sk. */
    }

    #apartments-table th:nth-child(4),
    #apartments-table td:nth-child(4) {
        width: 80px; /* Buto plotas */
    }

    #apartments-table th:nth-child(5),
    #apartments-table td:nth-child(5) {
        width: 100px; /* Terasa/Balkonas */
    }

    #apartments-table th:nth-child(6),
    #apartments-table td:nth-child(6) {
        width: 90px; /* Statusas */
    }

    .ret-filters {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .ret-filter-group {
        min-width: 120px;
    }

    .ret-room-btn,
    .ret-floor-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .ret-status {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    /* Ensure table wrapper doesn't cause horizontal scroll */
    .ret-table-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Status Badges */
.ret-status {
    display: inline-block;
    padding: 0.35rem 0.7rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.ret-status.laisvas {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.ret-status.rezervuotas {
    background-color: #ffebee;
    color: #c62828;
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_length select {
    padding: 0.25rem 2rem 0.25rem 0.5rem;
}

.dataTables_wrapper .dataTables_filter input {
    padding: 0.375rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.375rem 0.75rem;
    margin: 0 0.25rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #0d6efd;
    color: white !important;
    border-color: #0d6efd;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus Styles */
.ret-filter-group input:focus,
.ret-filter-group select:focus,
.ret-button:focus,
.ret-room-btn:focus,
.ret-floor-btn:focus,
.ret-clear-filters:focus {
    outline: 3px solid rgba(74, 108, 247, 0.3);
    outline-offset: 2px;
}

/* Smooth transition for table rows */
#apartments-table tbody tr {
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), 
                box-shadow 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
                background-color 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Add subtle row entry animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dataTables_wrapper .dataTable tbody tr {
    animation: fadeInUp 0.4s forwards;
    animation-delay: calc(var(--row-index, 0) * 0.05s);
}

/* Improved loading state */
.ret-table-container.loading .ret-table-scroll {
    opacity: 0.4;
    transition: opacity 0.3s ease;
    filter: blur(1px);
}

/* Improved hover effect for better tactile feedback */
#apartments-table tbody tr:hover td {
    background-color: rgba(248, 249, 250, 0.5);
}

#apartments-table tbody tr.rezervuotas:hover td {
    background-color: rgba(248, 215, 218, 0.2);
}

/* Scroll indicators */
.ret-table-scroll.can-scroll-right::after,
.ret-table-scroll.can-scroll-down::after {
    display: none !important;
    content: none !important;
    opacity: 0 !important;
}

.ret-table-scroll::after,
.ret-table-scroll::before {
    display: none !important;
    content: none !important;
    opacity: 0 !important;
}

/* Mobile scroll indicator */
.ret-table-wrapper.show-scroll-indicator::after {
    opacity: 1 !important;
}

/* Fixed first column on mobile - removing this to fix left side artifacts */
@media (max-width: 768px) {
    #apartments-table td:first-child, 
    #apartments-table th:first-child {
        position: static;
        left: auto;
        background: white;
        z-index: auto;
        box-shadow: none;
    }
    
    #apartments-table th:first-child {
        z-index: auto;
        background: linear-gradient(to bottom, #f8f9fa, #eef1f5);
    }
    
    #apartments-table tr.rezervuotas td:first-child {
        background-color: rgba(248, 215, 218, 0.25);
    }
}

/* Touch friendly scrolling */
.ret-table-scroll {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    touch-action: pan-x pan-y;
}

/* Improve scrollbar visibility */
.ret-table-scroll::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.ret-table-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(74, 108, 247, 0.4);
    border-radius: 10px;
    border: 2px solid #f8f9fa;
}

.ret-table-scroll::-webkit-scrollbar-thumb:hover {
    background-color: rgba(74, 108, 247, 0.6);
}

/* Enhanced hover states and scroll indicators */
.ret-table-scroll.hover-active::-webkit-scrollbar {
    width: 10px !important;
    height: 10px !important;
    opacity: 1;
    visibility: visible;
}

.ret-table-scroll.hover-active {
    scrollbar-width: thin;
}

.ret-table-scroll.has-vertical-scroll .ret-vertical-scroll-indicator {
    opacity: 0.6;
}

/* Cursor change on hover to indicate scrollable */
@media (min-width: 769px) {
    .ret-table-scroll.has-vertical-scroll {
        cursor: ns-resize;
    }
    
    .ret-table-scroll.can-scroll-right:not(.has-vertical-scroll) {
        cursor: ew-resize;
    }
    
    .ret-table-scroll.can-scroll-right.has-vertical-scroll {
        cursor: all-scroll;
    }
}

/* Mobile scrolling handling remains visible */
@media (max-width: 768px) {
    .ret-table-scroll::-webkit-scrollbar {
        width: 10px !important;
        height: 10px !important;
        opacity: 1;
        visibility: visible;
    }
    
    .ret-table-scroll {
        scrollbar-width: thin;
    }
}

/* Remove any remaining hover-only behaviors that might interfere with scrolling */
.ret-table-scroll.hover-active,
.ret-table-scroll.has-vertical-scroll,
.ret-table-scroll.hover-active::-webkit-scrollbar {
    /* Remove hover-only behaviors */
    opacity: 1;
    scrollbar-width: auto;
    cursor: auto;
}

#apartments-table thead th:first-child {
    padding-left: 1.5rem;
    border-top-left-radius: 16px;
}

#apartments-table thead th:last-child {
    padding-right: 1.5rem;
    border-top-right-radius: 16px;
}

/* Fix sorting icons - make sure basic styles are set */
#apartments-table thead th.sorting,
#apartments-table thead th.sorting_asc,
#apartments-table thead th.sorting_desc {
    position: relative;
    padding-right: 30px;
    cursor: pointer;
}

/* Filters section specific styling */
.ret-container .ret-filters {
    margin-bottom: 1.5rem;
    position: relative;
}

/* Add horizontal separator line */
.ret-container .ret-filters::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -10px;
    height: 1px;
    background: linear-gradient(to right, rgba(0,0,0,0.1), rgba(0,0,0,0.05), rgba(0,0,0,0));
}

/* Fix for sticky header to ensure it stays visible */
@media (min-width: 769px) {
    /* Make headers scroll with content by removing sticky positioning */
    #apartments-table thead th {
        position: static;
        background: linear-gradient(to bottom, #f8f9fa, #eef1f5);
        box-shadow: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    /* Remove the after element that causes lines during scrolling */
    #apartments-table thead::after {
        display: none;
    }
}

/* Remove the bottom gradient that causes the line to appear */
.ret-table-scroll::before {
    display: none;
}

/* Remove the scroll-down indicator that appears at bottom */
.ret-table-scroll.can-scroll-down::after {
    display: none;
}

/* Remove the mobile scroll indicator at the bottom */
.ret-table-wrapper::after {
    display: none !important;
}

/* Remove bottom line that might appear on table borders */
#apartments-table tbody tr:last-child td {
    border-bottom: none;
}

/* Make sure no shadows appear on scroll */
.ret-table-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(74, 108, 247, 0.4) #f8f9fa;
}

/* Remove any box shadows that might cause artifacts */
#apartments-table {
    box-shadow: none;
}

#apartments-table td:first-child, 
#apartments-table th:first-child {
    box-shadow: none !important;
}

/* Hide any loading text that might be shown */
.dataTables_processing {
    display: none !important;
}

/* Full Screen Mode */
.ret-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 1rem;
    background: #fff;
    z-index: 9999;
    overflow: hidden;
}

.ret-fullscreen-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #4a6cf7;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.ret-fullscreen-btn:hover {
    background: #3a5ce5;
    transform: translateY(-2px);
}

.ret-fullscreen-btn svg {
    width: 16px;
    height: 16px;
}

/* Mobile Responsiveness Improvements */
@media (max-width: 768px) {
    .ret-container {
        padding: 0.5rem;
    }

    #apartments-table {
        font-size: 0.85rem;
    }

    #apartments-table td, 
    #apartments-table th {
        padding: 0.5rem;
        min-width: 80px;
        max-width: 120px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ret-filters {
        padding: 1rem;
        gap: 1rem;
    }

    .ret-filter-group {
        min-width: 150px;
    }

    .ret-room-btn,
    .ret-floor-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* Full Screen Mobile Adjustments */
@media (max-width: 768px) {
    .ret-container.fullscreen {
        padding: 0.5rem;
    }

    .ret-container.fullscreen .ret-table-wrapper {
        height: calc(100vh - 2rem);
    }

    .ret-container.fullscreen .ret-filters {
        margin-bottom: 1rem;
    }
} 