/* Layout */
.rlr-container {
    display: flex;
    min-height: 100vh;
    min-width: 100%;
    font-family: 'Segoe UI', sans-serif;
}

.rlr-sidebar {
    width: 260px;
    background: #0f172a;
    color: #cbd5f5;
    display: flex;
    flex-direction: column;
    padding-top: 15px;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for sidebar */
.rlr-sidebar::-webkit-scrollbar {
    width: 8px;
}

.rlr-sidebar::-webkit-scrollbar-track {
    background: #0f172a;
}

.rlr-sidebar::-webkit-scrollbar-thumb {
    background: #38bdf8;
    border-radius: 4px;
}

.rlr-sidebar::-webkit-scrollbar-thumb:hover {
    background: #0ea5e9;
}

.rlr-sidebar::before {
    content: "Website Traffic";
    font-size: 18px;
    font-weight: 600;
    color: #38bdf8;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Mobile Menu Toggle */
.rlr-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: #38bdf8;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.rlr-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
    transition: 0.3s;
}

.rlr-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Menu */
.rlr-sidebar ul {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

/* Menu Items */
.rlr-sidebar li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    margin: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.25s ease;
}

/* Icons */
.rlr-sidebar li span {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Hover */
.rlr-sidebar li:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #fff;
}

/* Active */
.rlr-sidebar li.active {
    background: #38bdf8;
    color: #0f172a;
    font-weight: 600;
}

/* Content Area */
.rlr-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    background: #f1f5f9;
    transition: margin-left 0.3s ease;
}

.timing-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.timing-report-header h2 {
    margin: 0;
    font-weight: 600;
    color: #333;
}

.timing-report-select {
    padding: 8px 14px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timing-report-select:hover {
    border-color: #888;
}

.timing-report-select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.15);
}

.rlr-section {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.timing-filter {
    display: flex;
    gap: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.timing-filter > div {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.timing-filter label {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin-right: 4px;
}

.timing-filter select,
.timing-filter input {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    min-width: 140px;
}

.timing-filter select:hover,
.timing-filter input:hover {
    border-color: #94a3b8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.timing-filter select:focus,
.timing-filter input:focus {
    border-color: #38bdf8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.timing-filter button {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.apply-btn {
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
}

.apply-btn:hover {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
}

.reset-btn {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    color: #475569;
}

.reset-btn:hover {
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    transform: translateY(-1px);
}

.toggle {
    display: none;
}

table {
    width: 100%;
    table-layout: auto;
    margin-top: 30px;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: #fff;
}

table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #cbd5e1;
}

table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    font-size: 14px;
}

table tbody tr:hover {
    background: #f8fafc;
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* Switch container */
.switch {
    width: 60px;
    height: 34px;
    position: relative;
    display: inline-block;
}

/* Background */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

/* Circle knob */
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.sort-wrapper {
    margin-left: 50px;
    display: flex;
    gap: 10px;
    font-weight: 600;
    color: #333;
}

.toggle:checked+.slider {
    background-color: #38bdf8;
}

.toggle:checked+.slider:before {
    transform: translateX(26px);
}

/* Login Form */
#loginModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    width: 320px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: fadeIn 0.3s ease-in-out;
}

.login-box h2 {
    margin-bottom: 20px;
    font-size: 22px;
}

.login-box input {
    width: 93%;
    padding: 10px;
    margin: 8px 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

.login-box button {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    transition: 0.2s;
}

.login-box button:hover {
    background: #005177;
}

/* Error */
#loginError {
    color: red;
    font-size: 13px;
    margin-top: 10px;
}

/* loader styling */
.wtr-loader-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 40px;
    background: #f4f8fb;
}

.wtr-import-loader {
    max-width: 500px;
    width: 100%;
    background: #ffffff;
    border: 1px solid #dce3ea;
    border-radius: 16px;
    padding: 30px 28px;
    box-shadow: 0 16px 40px rgba(13, 30, 59, 0.08);
}

.wtr-loader-content {
    display: flex;
    align-items: center;
    gap: 18px;
}

.wtr-spinner {
    width: 46px;
    height: 46px;
    border: 5px solid #e9eef5;
    border-top: 5px solid #38bdf8;
    border-radius: 50%;
    animation: wtr-spin 1s linear infinite;
}

.wtr-loader-text {
    color: #0f172a;
}

.wtr-loader-text strong {
    display: block;
    color: #38bdf8;
    font-size: 20px;
    margin-bottom: 8px;
}

.wtr-loader-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
}

@keyframes wtr-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#wtr-reload-btn {
    padding: 8px 12px;
    background: #38bdf8;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
    margin-left: 10px;
    font-weight: 600;
}

#wtr-reload-btn:hover:not(:disabled) {
    background: #38bdf8;
}

#wtr-reload-btn:disabled {
    background: #aaa;
    cursor: not-allowed;
}

#wtr-reload-status {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: #ccc;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .rlr-sidebar {
        transform: translateX(-100%);
    }
    
    .rlr-sidebar.open {
        transform: translateX(0);
    }
    
    .rlr-overlay.active {
        display: block;
    }
    
    .rlr-menu-toggle {
        display: block;
    }
    
    .rlr-content {
        margin-left: 0 !important;
        padding: 60px 15px 20px 15px;
        width: 100%;
    }
    
    .rlr-container {
        flex-direction: column;
    }
    
    .timing-filter {
        padding: 12px 15px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .timing-filter > div {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .timing-filter label {
        margin-bottom: 4px;
    }
    
    .timing-filter select,
    .timing-filter input {
        width: 100%;
        min-width: unset;
    }
    
    .timing-filter button {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }
    
    .rlr-section {
        padding: 15px;
    }
    
    table {
        font-size: 12px;
    }
    
    table th,
    table td {
        padding: 10px 8px;
    }
    
    /* Table scroll on mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive table {
        min-width: 600px;
    }
    
    #dailyChartContainer,
    #monthlyChartContainer,
    #browserChartContainer,
    #osChartContainer,
    #statusChartContainer {
        height: 300px !important;
    }
}

@media (max-width: 480px) {
    .rlr-content {
        padding: 15px 10px;
    }
    
    .timing-filter {
        padding: 10px 12px;
    }
    
    .timing-filter select,
    .timing-filter input,
    .timing-filter button {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    table th,
    table td {
        padding: 8px 6px;
        font-size: 11px;
  }
}