/**
 * Modern Admin styles for FBS Secure Optimize plugin
 * @since 1.0.0
 * @author Fazle Bari <fazlebarisn@gmail.com>
 * @package FBS_Optimize
 */

/* ==========================================================================
   Dependent Options
   ========================================================================== */

.fbs-opt-dependent-option.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.fbs-opt-dependent-option.disabled .fbs-opt-option-header h4 {
    color: #999;
}

.fbs-opt-dependent-option.disabled select,
.fbs-opt-dependent-option.disabled input,
.fbs-opt-dependent-option.disabled textarea {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* ==========================================================================
   Main Admin Layout
   ========================================================================== */

.fbs-opt-admin-wrap {
    background: #f8f9fa;
    min-height: 100vh;
    margin: -20px -20px 0 -20px;
    padding: 0;
}

.fbs-opt-admin-wrap .fbs-opt-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 40px 30px;
    margin-bottom: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.fbs-opt-admin-wrap .fbs-opt-title {
    font-size: 32px;
    font-weight: 600;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #fff;
}

.fbs-opt-admin-wrap .fbs-opt-title .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
}

.fbs-opt-admin-wrap .fbs-opt-subtitle {
    font-size: 16px;
    margin: 0;
    opacity: 0.9;
    font-weight: 400;
}

/* ==========================================================================
   Tabs Navigation
   ========================================================================== */

   .fbs-opt-admin-wrap .fbs-opt-tabs {
    background: white;
    border-bottom: 1px solid #e1e5e9;
    padding: 0 40px;
    margin-bottom: 0;
}

.fbs-opt-admin-wrap .fbs-opt-tabs .nav-tab-wrapper {
    border-bottom: none;
    margin: 0;
    padding: 0;
}

.fbs-opt-admin-wrap .fbs-opt-tabs .nav-tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6c757d;
    font-weight: 500;
    font-size: 15px;
    padding: 20px 25px;
    margin: 0;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.fbs-opt-admin-wrap .fbs-opt-tabs .nav-tab:hover {
    background: #f8f9fa;
    color: #495057;
    border-bottom-color: #dee2e6;
}

.fbs-opt-admin-wrap .fbs-opt-tabs .nav-tab-active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f8f9fa;
}

.fbs-opt-admin-wrap .fbs-opt-tabs .nav-tab .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */

   .fbs-opt-admin-wrap .fbs-opt-admin-content {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.fbs-opt-admin-wrap .fbs-opt-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.fbs-opt-admin-wrap .fbs-opt-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Forms and Sections
   ========================================================================== */

   .fbs-opt-admin-wrap .fbs-opt-form {
    background: transparent;
}

.fbs-opt-admin-wrap .fbs-opt-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    overflow: hidden;
}

.fbs-opt-admin-wrap .fbs-opt-section-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px 30px;
    border-bottom: 1px solid #e1e5e9;
}

.fbs-opt-admin-wrap .fbs-opt-section-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 12px;
}

.fbs-opt-admin-wrap .fbs-opt-section-title .dashicons {
    color: #667eea;
    font-size: 22px;
    width: 22px;
    height: 22px;
}

.fbs-opt-admin-wrap .fbs-opt-section-description {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
}

/* ==========================================================================
   Options Grid
   ========================================================================== */

   .fbs-opt-admin-wrap .fbs-opt-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    padding: 30px;
}

.fbs-opt-admin-wrap .fbs-opt-option-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.fbs-opt-admin-wrap .fbs-opt-option-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.fbs-opt-admin-wrap .fbs-opt-option-card-wide {
    grid-column: 1 / -1;
}

.fbs-opt-admin-wrap .fbs-opt-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.fbs-opt-admin-wrap .fbs-opt-option-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.fbs-opt-admin-wrap .fbs-opt-option-description {
    margin: 0;
    color: #6c757d;
    font-size: 13px;
    line-height: 1.4;
}

/* ==========================================================================
   Toggle Switches
   ========================================================================== */

.fbs-opt-admin-wrap .fbs-opt-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.fbs-opt-admin-wrap .fbs-opt-toggle input[type="checkbox"] {
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    outline: none !important;
}

.fbs-opt-admin-wrap .fbs-opt-slider {
    position: absolute !important;
    cursor: pointer !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-color: #ccc !important;
    transition: 0.3s !important;
    border-radius: 28px !important;
    display: block !important;
    z-index: 1 !important;
}

.fbs-opt-admin-wrap .fbs-opt-slider:before {
    position: absolute !important;
    content: "" !important;
    height: 22px !important;
    width: 22px !important;
    left: 3px !important;
    bottom: 3px !important;
    background-color: white !important;
    transition: 0.3s !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.fbs-opt-admin-wrap .fbs-opt-toggle input[type="checkbox"]:checked + .fbs-opt-slider {
    background-color: #667eea !important;
}

.fbs-opt-admin-wrap .fbs-opt-toggle input[type="checkbox"]:checked + .fbs-opt-slider:before {
    transform: translateX(22px) !important;
}

.fbs-opt-admin-wrap .fbs-opt-toggle input[type="checkbox"]:focus + .fbs-opt-slider {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.fbs-opt-admin-wrap .fbs-opt-toggle:hover .fbs-opt-slider {
    background-color: #bbb;
}

.fbs-opt-admin-wrap .fbs-opt-toggle input[type="checkbox"]:checked + .fbs-opt-slider:hover {
    background-color: #5a6fd8;
}

.fbs-opt-admin-wrap .fbs-opt-toggle.changing .fbs-opt-slider {
    transform: scale(0.95);
}

/* ==========================================================================
   Form Controls
   ========================================================================== */

   .fbs-opt-admin-wrap .fbs-opt-input,
   .fbs-opt-admin-wrap .fbs-opt-select,
   .fbs-opt-admin-wrap .fbs-opt-textarea {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    color: #374151;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 200px;
}

.fbs-opt-admin-wrap .fbs-opt-input:focus,
.fbs-opt-admin-wrap .fbs-opt-select:focus,
.fbs-opt-admin-wrap .fbs-opt-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.fbs-opt-admin-wrap .fbs-opt-textarea {
    max-width: 100%;
    min-height: 80px;
    resize: vertical;
}

/* ==========================================================================
   Action Cards
   ========================================================================== */

   .fbs-opt-admin-wrap .fbs-opt-cleanup-actions {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin: 30px 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0;
}

.fbs-opt-admin-wrap .fbs-opt-action-card {
    padding: 30px;
    text-align: center;
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border-left: 4px solid #e53e3e;
}

.fbs-opt-admin-wrap .fbs-opt-action-card:last-child {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left-color: #0ea5e9;
}

.fbs-opt-admin-wrap .fbs-opt-action-card h3 {
    margin: 0 0 10px 0;
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
}

.fbs-opt-admin-wrap .fbs-opt-action-card p {
    margin: 0 0 20px 0;
    color: #4a5568;
    font-size: 14px;
}

/* ==========================================================================
   Cache Management
   ========================================================================== */

.fbs-opt-admin-wrap .fbs-opt-cache-management {
    padding: 30px;
}

.fbs-opt-admin-wrap .fbs-opt-cache-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.fbs-opt-admin-wrap .fbs-opt-cache-details h4,
.fbs-opt-admin-wrap .fbs-opt-cache-actions h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.fbs-opt-admin-wrap .fbs-opt-cache-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.fbs-opt-admin-wrap .fbs-opt-cache-details li {
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
    color: #6c757d;
    font-size: 14px;
}

.fbs-opt-admin-wrap .fbs-opt-cache-details li:last-child {
    border-bottom: none;
}

.fbs-opt-admin-wrap .fbs-opt-cache-details strong {
    color: #2c3e50;
    font-weight: 600;
}

.fbs-opt-admin-wrap .fbs-opt-cache-actions p {
    margin: 0 0 20px 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

   .fbs-opt-admin-wrap .fbs-opt-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.fbs-opt-admin-wrap .fbs-opt-button-primary {
    background: #135e96;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    padding: 7px 22px;
    border-radius: 8px;
}

.fbs-opt-admin-wrap .fbs-opt-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: #0c4169;
    color: white;
}

.fbs-opt-admin-wrap .fbs-opt-button-secondary {
    background: #6c757d;
    color: white;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.fbs-opt-admin-wrap .fbs-opt-button-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
    color: white;
}

.fbs-opt-admin-wrap .fbs-opt-form-actions {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 25px 30px;
    text-align: center;
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

/* ==========================================================================
   Statistics
   ========================================================================== */

   .fbs-opt-admin-wrap .fbs-opt-stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.fbs-opt-admin-wrap .fbs-opt-overview-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.fbs-opt-admin-wrap .fbs-opt-overview-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.fbs-opt-admin-wrap .fbs-opt-overview-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fbs-opt-admin-wrap .fbs-opt-overview-icon .dashicons {
    color: white;
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.fbs-opt-admin-wrap .fbs-opt-overview-content h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.fbs-opt-admin-wrap .fbs-opt-overview-content p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.4;
}

.fbs-opt-admin-wrap .fbs-opt-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 30px;
}

.fbs-opt-admin-wrap .fbs-opt-stat-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.fbs-opt-admin-wrap .fbs-opt-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.fbs-opt-admin-wrap .fbs-opt-stat-card:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    transform: translateY(-3px);
}

.fbs-opt-admin-wrap .fbs-opt-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fbs-opt-admin-wrap .fbs-opt-stat-icon .dashicons {
    color: white;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.fbs-opt-admin-wrap .fbs-opt-stat-content {
    flex: 1;
}

.fbs-opt-admin-wrap .fbs-opt-stat-content h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.fbs-opt-admin-wrap .fbs-opt-stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.fbs-opt-admin-wrap .fbs-opt-stat-number.fbs-opt-score {
    color: #10b981;
}

.fbs-opt-admin-wrap .fbs-opt-stat-description {
    margin: 0;
    color: #6c757d;
    font-size: 13px;
    line-height: 1.4;
}

/* ==========================================================================
   Performance Metrics
   ========================================================================== */

.fbs-opt-admin-wrap .fbs-opt-performance-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 30px;
}

.fbs-opt-admin-wrap .fbs-opt-metric-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s ease;
}

.fbs-opt-admin-wrap .fbs-opt-metric-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.fbs-opt-admin-wrap .fbs-opt-metric-card h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.fbs-opt-admin-wrap .fbs-opt-metric-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.fbs-opt-admin-wrap .fbs-opt-metric-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.8s ease;
}

.fbs-opt-admin-wrap .fbs-opt-metric-value {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
}

/* ==========================================================================
   Status and Notifications
   ========================================================================== */

.fbs-opt-admin-wrap #fbs-opt-cleanup-status,
.fbs-opt-admin-wrap #fbs-opt-cache-status {
    margin-left: 15px;
    font-weight: 500;
    font-size: 14px;
    display: inline-block;
    min-height: 20px;
}

.fbs-opt-admin-wrap .fbs-opt-cleanup-status.success {
    color: #10b981;
}

.fbs-opt-admin-wrap .fbs-opt-cleanup-status.error {
    color: #ef4444;
}

.fbs-opt-admin-wrap .fbs-opt-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: fbs-opt-spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes fbs-opt-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1200px) {
    .fbs-opt-admin-wrap .fbs-opt-admin-content {
        padding: 30px 20px;
    }
    
    .fbs-opt-admin-wrap .fbs-opt-header {
        padding: 30px 20px 25px;
    }
    
    .fbs-opt-admin-wrap .fbs-opt-tabs {
        padding: 0 20px;
    }
}

@media (max-width: 768px) {
    .fbs-opt-admin-wrap .fbs-opt-title {
        font-size: 24px;
    }
    
    .fbs-opt-admin-wrap .fbs-opt-options-grid {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .fbs-opt-admin-wrap .fbs-opt-stats-grid {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .fbs-opt-admin-wrap .fbs-opt-stats-overview {
        grid-template-columns: 1fr;
    }
    
    .fbs-opt-admin-wrap .fbs-opt-performance-metrics {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .fbs-opt-admin-wrap .fbs-opt-overview-card {
        flex-direction: column;
        text-align: center;
    }
    
    .fbs-opt-admin-wrap .fbs-opt-stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .fbs-opt-admin-wrap .fbs-opt-tabs .nav-tab {
        padding: 15px 20px;
        font-size: 14px;
    }
    
    .fbs-opt-admin-wrap .fbs-opt-cache-info {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .fbs-opt-admin-wrap .fbs-opt-cleanup-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .fbs-opt-admin-wrap .fbs-opt-admin-content {
        padding: 20px 15px;
    }
    
    .fbs-opt-admin-wrap .fbs-opt-header {
        padding: 25px 15px 20px;
    }
    
    .fbs-opt-admin-wrap .fbs-opt-tabs {
        padding: 0 15px;
    }
    
    .fbs-opt-admin-wrap .fbs-opt-section-header {
        padding: 20px;
    }
    
    .fbs-opt-admin-wrap .fbs-opt-options-grid {
        padding: 15px;
    }
    
    .fbs-opt-admin-wrap .fbs-opt-stats-grid {
        padding: 15px;
    }
}

/* ==========================================================================
   WordPress Admin Integration
   ========================================================================== */

.fbs-opt-admin-wrap .notice {
    margin: 20px 0;
    border-radius: 8px;
    border-left-width: 4px;
}

.fbs-opt-admin-wrap .notice-success {
    background: #d1fae5;
    border-left-color: #10b981;
    color: #065f46;
}

.fbs-opt-admin-wrap .notice-error {
    background: #fee2e2;
    border-left-color: #ef4444;
    color: #991b1b;
}

.fbs-opt-admin-wrap .notice-warning {
    background: #fef3c7;
    border-left-color: #f59e0b;
    color: #92400e;
}

.fbs-opt-admin-wrap .notice-info {
    background: #dbeafe;
    border-left-color: #3b82f6;
    color: #1e40af;
}

/* ==========================================================================
   Dependent Options
   ========================================================================== */

.fbs-opt-admin-wrap .fbs-opt-dependent-option {
    transition: all 0.3s ease;
}

.fbs-opt-admin-wrap .fbs-opt-dependent-option.disabled {
    opacity: 0.5;
    pointer-events: none;
    background: #f1f3f4;
    border-color: #e1e5e9;
}

.fbs-opt-admin-wrap .fbs-opt-dependent-option.disabled .fbs-opt-option-header h4 {
    color: #9aa0a6;
}

.fbs-opt-admin-wrap .fbs-opt-dependent-option.disabled .fbs-opt-option-description {
    color: #9aa0a6;
}

.fbs-opt-admin-wrap .fbs-opt-dependent-option.disabled .fbs-opt-select,
.fbs-opt-admin-wrap .fbs-opt-dependent-option.disabled .fbs-opt-input {
    background: #f8f9fa;
    color: #9aa0a6;
    cursor: not-allowed;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.fbs-opt-admin-wrap .fbs-opt-toggle input:focus + .fbs-opt-slider {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.fbs-opt-admin-wrap .fbs-opt-button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.fbs-opt-admin-wrap .fbs-opt-input:focus,
.fbs-opt-admin-wrap .fbs-opt-select:focus,
.fbs-opt-admin-wrap .fbs-opt-textarea:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .fbs-opt-admin-wrap .fbs-opt-admin-wrap {
        background: white;
    }
    
    .fbs-opt-admin-wrap .fbs-opt-header {
        background: #f8f9fa;
        color: #2c3e50;
    }
    
    .fbs-opt-admin-wrap .fbs-opt-tabs {
        display: none;
    }
    
    .fbs-opt-admin-wrap .fbs-opt-tab-content {
        display: block !important;
    }
    
    .fbs-opt-admin-wrap .fbs-opt-button {
        display: none;
    }
}

/* Login Security Styles */
.fbs-opt-admin-wrap .fbs-opt-login-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px;
    margin: 16px 0;
    border-radius: 4px;
}

.fbs-opt-admin-wrap .fbs-opt-login-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px;
    margin: 16px 0;
    border-radius: 4px;
}

/* Statistics Tab Styles */
.fbs-opt-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.fbs-opt-stat-card {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fbs-opt-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.fbs-opt-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    margin-bottom: 15px;
}

.fbs-opt-stat-icon .dashicons {
    color: #fff;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.fbs-opt-stat-content h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.fbs-opt-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

.fbs-opt-stat-item:last-child {
    border-bottom: none;
}

.fbs-opt-stat-label {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

.fbs-opt-stat-value {
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 60px;
    text-align: center;
}

/* ==========================================================================
   AJAX Form Handling
   ========================================================================== */

.fbs-opt-button-primary.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.fbs-opt-button-primary.loading .dashicons {
    animation: spin 1s linear infinite;
}

.fbs-opt-save-status {
    margin-left: 10px;
    font-size: 14px;
    font-weight: 500;
}

.fbs-opt-save-status .dashicons {
    margin-right: 5px;
    vertical-align: middle;
}

.fbs-opt-save-status .dashicons.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fbs-opt-notice {
    padding: 12px 16px;
    margin: 15px 0;
    border-radius: 4px;
    font-weight: 500;
    border-left: 4px solid;
}

.fbs-opt-notice.success {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.fbs-opt-notice.error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

.fbs-opt-notice.info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: #17a2b8;
}

/* ==========================================================================
   Beautiful Popup Notification System
   ========================================================================== */

#fbs-opt-popup-container {
    position: fixed;
    top: 32px;
    right: 20px;
    z-index: 999999;
    max-width: min(400px, calc(100vw - 40px));
    width: auto;
    pointer-events: none;
}

.fbs-opt-popup {
    position: relative;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border-left: 4px solid;
    overflow: hidden;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0);
    opacity: 1;
}

.fbs-opt-popup:hover {
    transform: translateX(-5px) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.fbs-opt-popup-content {
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
    position: relative;
    z-index: 2;
}

.fbs-opt-popup-icon {
    flex-shrink: 0;
    margin-right: 12px;
    margin-top: 2px;
}

.fbs-opt-popup-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 1;
}

.fbs-opt-popup-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
    padding-right: 8px;
}

.fbs-opt-popup-close {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    opacity: 0.7;
}

.fbs-opt-popup-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
    opacity: 1;
}

.fbs-opt-popup-close .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}

.fbs-opt-popup-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: rgba(0, 0, 0, 0.2);
    width: 0%;
    transition: width 0.1s linear;
}

/* Popup Type Variations */
.fbs-opt-popup.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left-color: #28a745;
    color: #155724;
}

.fbs-opt-popup.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left-color: #dc3545;
    color: #721c24;
}

.fbs-opt-popup.warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left-color: #ffc107;
    color: #856404;
}

.fbs-opt-popup.info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border-left-color: #17a2b8;
    color: #0c5460;
}

/* Animation for multiple popups */
.fbs-opt-popup:nth-child(2) {
    animation-delay: 0.1s;
}

.fbs-opt-popup:nth-child(3) {
    animation-delay: 0.2s;
}

.fbs-opt-popup:nth-child(4) {
    animation-delay: 0.3s;
}

/* Responsive adjustments */
@media (max-width: 782px) {
    #fbs-opt-popup-container {
        top: 46px;
        right: 10px;
        left: 10px;
        max-width: none;
        width: auto;
    }
    
    .fbs-opt-popup {
        margin-bottom: 10px;
    }
    
    .fbs-opt-popup-content {
        padding: 14px 16px;
    }
    
    .fbs-opt-popup-message {
        font-size: 13px;
    }
}

/* Ensure popup is always visible on smaller screens */
@media (max-width: 600px) {
    #fbs-opt-popup-container {
        top: 20px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* WordPress admin bar adjustments */
@media screen and (max-width: 782px) {
    #fbs-opt-popup-container {
        top: 46px;
    }
}

@media screen and (min-width: 783px) {
    #fbs-opt-popup-container {
        top: 32px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .fbs-opt-popup {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }
    
    .fbs-opt-popup:hover {
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    }
    
    .fbs-opt-popup-close:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

/* Accessibility improvements */
.fbs-opt-popup:focus-within {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.fbs-opt-popup-close:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .fbs-opt-popup {
        border: 2px solid;
        box-shadow: none;
    }
    
    .fbs-opt-popup-close {
        border: 1px solid;
    }
}
