/* ========================================
   Bot Traffic Shield - Modern Admin Styles
   ======================================== */

/* Main Container */
.btsld-wrap {
    margin-top: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.btsld-wrap h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.btsld-wrap > p {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 24px;
}

/* Modern Tab Navigation */
.btsld-wrap .nav-tab-wrapper {
    border: none;
    margin-bottom: 30px;
    background: #f8fafc;
    padding: 8px;
    border-radius: 12px;
    display: inline-flex;
    gap: 6px;
}

.btsld-wrap .nav-tab {
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 500;
    font-size: 14px;
    padding: 10px 20px;
    margin: 0;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btsld-wrap .nav-tab:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

.btsld-wrap .nav-tab-active,
.btsld-wrap .nav-tab-active:hover {
    background: #ffffff;
    color: #3b82f6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Tab Content */
.btsld-wrap .btsld-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.btsld-wrap .btsld-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modern Cards */
.btsld-wrap .btsld-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.btsld-wrap .btsld-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.btsld-wrap .btsld-card h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-top: 0;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.btsld-wrap .btsld-card p {
    color: #475569;
    line-height: 1.6;
}

.btsld-wrap .btsld-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.btsld-wrap .btsld-card ul li {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
}

.btsld-wrap .btsld-card ul li:last-child {
    border-bottom: none;
}

.btsld-wrap .btsld-card ul li code {
    background: #f1f5f9;
    color: #3b82f6;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: "Monaco", "Menlo", "Consolas", monospace;
}

/* Form Table Styling */
.btsld-wrap .form-table {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btsld-wrap .form-table th {
    width: 280px;
    padding: 20px;
    font-weight: 600;
    color: #1e293b;
    background: #f8fafc;
}

.btsld-wrap .form-table td {
    padding: 20px;
}

.btsld-wrap .form-table textarea {
    width: 100%;
    max-width: 600px;
    min-height: 140px;
    font-family: "Monaco", "Menlo", "Consolas", monospace;
    font-size: 13px;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: #ffffff;
}

.btsld-wrap .form-table textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btsld-wrap .form-table .description {
    color: #64748b;
    font-size: 13px;
    margin-top: 8px;
    line-height: 1.5;
}

/* Modern Toggle Switch */
.btsld-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.btsld-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.btsld-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 28px;
}

.btsld-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .btsld-slider {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

input:focus + .btsld-slider {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

input:checked + .btsld-slider:before {
    transform: translateX(24px);
}

.btsld-slider:hover {
    background-color: #94a3b8;
}

input:checked + .btsld-slider:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

/* Modern Buttons */
.btsld-wrap .button-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    color: #ffffff;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
    text-shadow: none;
}

.btsld-wrap .button-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btsld-wrap .button-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btsld-wrap .button-secondary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-weight: 500;
    padding: 9px 20px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btsld-wrap .button-secondary:hover {
    background: #f8fafc;
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Form Select Dropdown */
.btsld-wrap select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    background: #ffffff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%23475569" d="M6 9L1 4h10z"/></svg>') no-repeat right 10px center;
    background-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    margin-right: 12px;
}

.btsld-wrap select:hover {
    border-color: #3b82f6;
}

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

/* Statistics Display */
.btsld-wrap .btsld-card p strong {
    color: #1e293b;
    font-weight: 600;
}

/* Log Table Styling */
.btsld-wrap .btsld-log-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 16px;
}

.btsld-wrap .btsld-log-table thead th {
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.btsld-wrap .btsld-log-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    color: #334155;
    word-break: break-word;
}

.btsld-wrap .btsld-log-table tbody tr {
    transition: background-color 0.15s ease;
}

.btsld-wrap .btsld-log-table tbody tr:hover {
    background-color: #f8fafc;
}

.btsld-wrap .btsld-log-table tbody tr:last-child td {
    border-bottom: none;
}

/* Empty State */
.btsld-wrap .btsld-card > p:only-child {
    color: #94a3b8;
    font-style: italic;
    text-align: center;
    padding: 20px;
    margin: 0;
}

/* Label Styling for Forms */
.btsld-wrap label[for] {
    font-weight: 500;
    color: #334155;
    margin-right: 12px;
}

/* Responsive Design */
@media screen and (max-width: 782px) {
    .btsld-wrap .nav-tab-wrapper {
        flex-direction: column;
    }
    
    .btsld-wrap .form-table th,
    .btsld-wrap .form-table td {
        display: block;
        width: 100%;
        padding: 12px;
    }
    
    .btsld-wrap .form-table th {
        background: #f8fafc;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .btsld-wrap .btsld-log-table {
        font-size: 12px;
    }
    
    .btsld-wrap .btsld-log-table thead {
        display: none;
    }
    
    .btsld-wrap .btsld-log-table tbody td {
        display: block;
        text-align: right;
        padding: 8px 12px;
        position: relative;
        padding-left: 50%;
    }
    
    .btsld-wrap .btsld-log-table tbody td:before {
        content: attr(data-label);
        position: absolute;
        left: 12px;
        font-weight: 600;
        text-transform: uppercase;
        font-size: 11px;
        color: #64748b;
    }
}

/* Accessibility */
.btsld-wrap *:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.btsld-wrap .button:focus,
.btsld-wrap select:focus,
.btsld-wrap textarea:focus,
.btsld-switch input:focus + .btsld-slider {
    outline: none;
}

/* Success/Info Messages */
.btsld-wrap .updated,
.btsld-wrap .notice {
    border-left: 4px solid #10b981;
    background: #f0fdf4;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.btsld-wrap .notice-info {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.btsld-wrap .notice-warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.btsld-wrap .notice-error {
    border-left-color: #ef4444;
    background: #fef2f2;
}

/* Export CSV Button - Special Styling */
.button[value="Export CSV"] {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: #ffffff;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    margin-left: 12px;
    text-shadow: none;
}

.button[value="Export CSV"]:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
    color: #ffffff;
}

.button[value="Export CSV"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}


/* ========================================
   Modern Pagination Styles
   ======================================== */

/* Pagination Container */
.btsld-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin: 20px 0;
    gap: 20px;
}

/* Item Counter */
.btsld-displaying-num {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    background: #f8fafc;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* Pagination Links Container */
.btsld-pagination-links {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* Page Number Links & Current Page */
.btsld-pagination-links a,
.btsld-pagination-links span.current,
.btsld-pagination-links span.dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    text-align: center;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    text-decoration: none;
    color: #475569;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

/* Current Active Page */
.btsld-pagination-links span.current {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
    cursor: default;
}

/* Page Number Hover */
.btsld-pagination-links a:hover {
    background: #f8fafc;
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Page Number Active (Click) */
.btsld-pagination-links a:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Dots (Ellipsis) */
.btsld-pagination-links .dots {
    border: none;
    background: transparent;
    cursor: default;
    min-width: 40px;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: 2px;
}

.btsld-pagination-links .dots:hover {
    transform: none;
    box-shadow: none;
    background: transparent;
}

/* Previous & Next Buttons */
.btsld-pagination-links .prev,
.btsld-pagination-links .next {
    font-weight: 600;
    padding: 0 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #cbd5e1;
    color: #475569;
}

.btsld-pagination-links .prev:hover,
.btsld-pagination-links .next:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

/* Disabled State (if implemented) */
.btsld-pagination-links .prev.disabled,
.btsld-pagination-links .next.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Compact Pagination (for mobile) */
@media screen and (max-width: 782px) {
    .btsld-pagination {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 16px;
        background: #f8fafc;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
    }
    
    .btsld-displaying-num {
        text-align: center;
        width: 100%;
    }
    
    .btsld-pagination-links {
        justify-content: center;
        gap: 4px;
    }
    
    .btsld-pagination-links a,
    .btsld-pagination-links span.current,
    .btsld-pagination-links span.dots {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 13px;
    }
    
    .btsld-pagination-links .prev,
    .btsld-pagination-links .next {
        padding: 0 12px;
    }
}

/* Extra Small Screens */
@media screen and (max-width: 480px) {
    .btsld-pagination-links a,
    .btsld-pagination-links span.current {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 12px;
    }
    
    /* Hide some page numbers on very small screens */
    .btsld-pagination-links a:not(.prev):not(.next):not(:nth-child(-n+3)):not(:nth-last-child(-n+3)) {
        display: none;
    }
}

/* Top Pagination Specific Styling */
.btsld-card .btsld-pagination:first-of-type {
    margin-top: 0;
    padding-top: 0;
}

/* Bottom Pagination Specific Styling */
.btsld-card .btsld-pagination:last-of-type {
    margin-bottom: 0;
    padding-bottom: 0;
    border-top: 2px solid #f1f5f9;
    padding-top: 20px;
}

/* Loading State Animation (Optional Enhancement) */
@keyframes paginationPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.btsld-pagination.loading {
    animation: paginationPulse 1.5s ease-in-out infinite;
}

/* Page Info Text (Optional - shows "Page 1 of 10") */
.btsld-pagination-info {
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* Smooth Scrolling when clicking pagination */
html {
    scroll-behavior: smooth;
}

/* Focus States for Accessibility */
.btsld-pagination-links a:focus,
.btsld-pagination-links span.current:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .btsld-pagination {
        /* Add dark mode styles if needed */
    }
}

/* ========================================
   End Modern Pagination Styles
   ======================================== */


   /* ==========================================================================
   Clear Logs Button Styles
   ========================================================================== */

.btsld-clear-logs-wrapper {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#btsld-clear-logs-btn {
    color: #d63638;
    border-color: #d63638;
    transition: all 0.2s ease;
}

#btsld-clear-logs-btn:hover {
    background: #d63638;
    color: #fff;
    border-color: #d63638;
}

#btsld-clear-logs-btn:focus {
    outline: none;
    box-shadow: 0 0 0 1px #fff, 0 0 0 3px #d63638;
}

#btsld-clear-logs-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f0f0f0;
    border-color: #ddd;
    color: #999;
}

/* ==========================================================================
   Message Styles
   ========================================================================== */

.btsld-message {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 4px;
    display: inline-block;
}

.btsld-message:empty {
    display: none;
}

.btsld-message.btsld-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.btsld-message.btsld-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================================================
   Empty Log Message
   ========================================================================== */

#btsld-empty-log-message {
    color: #666;
    font-style: italic;
    padding: 20px;
    background: #f9f9f9;
    border: 1px dashed #ddd;
    border-radius: 4px;
    text-align: center;
}

/* End of Bot Traffic Shield - Modern Admin Styles */