/* Modern Sync Monitor Styles */
.sync-monitor-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

    /* Header Styles */
    .sync-monitor-container .header {
        text-align: center;
        margin-bottom: 2rem;
    }

        .sync-monitor-container .header h1 {
            font-size: 2.5rem;
            color: #1a1a1a;
            margin-bottom: 0.5rem;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

    .sync-monitor-container .subtitle {
        color: #666;
        font-size: 1.1rem;
    }

    /* Statistics Section */
    .sync-monitor-container .stats-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .sync-monitor-container .stat-card {
        background: rgba(255, 255, 255, 0.95);
        border: none;
        border-radius: 16px;
        padding: 1.25rem 1rem;
        text-align: center;
        backdrop-filter: blur(10px);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        position: relative;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        min-height: 120px;
    }

        .sync-monitor-container .stat-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, #667eea, #764ba2);
        }

        .sync-monitor-container .stat-card:hover {
            transform: translateY(-8px);
            box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
        }

        .sync-monitor-container .stat-card.active::before {
            background: linear-gradient(90deg, #4ade80, #22c55e);
        }

        .sync-monitor-container .stat-card.inactive::before {
            background: linear-gradient(90deg, #ef4444, #dc2626);
        }

        .sync-monitor-container .stat-card.sync-time::before {
            background: linear-gradient(90deg, #3b82f6, #1d4ed8);
        }

    .sync-monitor-container .stat-label {
        font-size: 0.85rem;
        color: #666;
        margin-bottom: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-weight: 500;
        line-height: 1.2;
    }

    .sync-monitor-container .stat-value {
        font-size: 1.75rem;
        font-weight: 700;
        color: #1a1a1a;
        line-height: 1.1;
        margin: 0;
    }

    /* Controls Section */
    .sync-monitor-container .controls-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 2rem;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .sync-monitor-container .search-box {
        position: relative;
        flex: 1;
        min-width: 300px;
    }

    .sync-monitor-container .search-input {
        width: 100%;
        padding: 0.875rem 2.5rem 0.875rem 1.25rem;
        font-size: 1rem;
        border: none;
        border-radius: 12px;
        outline: none;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
    }

        .sync-monitor-container .search-input:focus {
            transform: translateY(-2px);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
        }

    .sync-monitor-container .clear-search-btn {
        position: absolute;
        right: 0.75rem;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        font-size: 1.2rem;
        color: #999;
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 50%;
        transition: all 0.2s ease;
    }

        .sync-monitor-container .clear-search-btn:hover {
            color: #333;
            background-color: #f0f0f0;
        }

    .sync-monitor-container .info-text {
        color: #666;
        font-size: 0.95rem;
        font-weight: 500;
    }

    .sync-monitor-container .live-indicator {
        margin-left: 1rem;
        color: #22c55e;
        font-size: 0.85rem;
        font-weight: 600;
        animation: liveIndicatorPulse 1.5s infinite ease-in-out;
    }

@keyframes liveIndicatorPulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Table Row Section - MODERNIZED */
.sync-monitor-container .table-list {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 16px;
    padding: 0;
    margin-bottom: 2rem;
    max-height: none;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    /* Flex column layout for rows */
    display: flex;
    flex-direction: column;
}

/* Table Header */
.sync-monitor-container .table-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

    .sync-monitor-container .table-header .header-status {
        width: 60px;
        text-align: center;
    }

    .sync-monitor-container .table-header .header-name {
        flex: 1;
        min-width: 200px;
    }

    .sync-monitor-container .table-header .header-synced {
        width: 180px;
        text-align: center;
    }

    .sync-monitor-container .table-header .header-actions {
        width: 120px;
        text-align: center;
    }

.sync-monitor-container .table-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

    .sync-monitor-container .table-item:last-of-type {
        border-bottom: none;
    }

    .sync-monitor-container .table-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 4px;
        background: linear-gradient(180deg, #667eea, #764ba2);
        transform: scaleY(0);
        transition: transform 0.3s ease;
    }

    .sync-monitor-container .table-item:hover {
        background: rgba(102, 126, 234, 0.05);
        transform: translateX(4px);
    }

        .sync-monitor-container .table-item:hover::before {
            transform: scaleY(1);
        }

    .sync-monitor-container .table-item.active::before {
        background: linear-gradient(180deg, #4ade80, #22c55e);
        transform: scaleY(1);
    }

    .sync-monitor-container .table-item.active:hover {
        background: rgba(34, 197, 94, 0.05);
    }

    .sync-monitor-container .table-item.inactive::before {
        background: linear-gradient(180deg, #ef4444, #dc2626);
        transform: scaleY(1);
    }

    .sync-monitor-container .table-item.inactive:hover {
        background: rgba(239, 68, 68, 0.05);
    }

.sync-monitor-container .table-status {
    width: 60px;
    display: flex;
    justify-content: center;
    cursor: pointer;
}

.sync-monitor-container .status-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
}

    .sync-monitor-container .status-circle::after {
        content: '';
        position: absolute;
        inset: -4px;
        border-radius: 50%;
        transition: all 0.3s ease;
        opacity: 0;
    }

    .sync-monitor-container .status-circle:hover {
        transform: scale(1.2);
    }

        .sync-monitor-container .status-circle:hover::after {
            opacity: 1;
        }

    .sync-monitor-container .status-circle.active {
        background: linear-gradient(135deg, #4ade80, #22c55e);
        box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
    }

        .sync-monitor-container .status-circle.active::after {
            background: radial-gradient(circle, rgba(34, 197, 94, 0.2) 0%, transparent 70%);
        }

    .sync-monitor-container .status-circle.inactive {
        background: linear-gradient(135deg, #ef4444, #dc2626);
        box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
    }

        .sync-monitor-container .status-circle.inactive::after {
            background: radial-gradient(circle, rgba(220, 38, 38, 0.2) 0%, transparent 70%);
        }

.sync-monitor-container .table-info {
    flex: 1;
    min-width: 200px;
    padding-right: 1rem;
}

.sync-monitor-container .table-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1a1a1a;
    line-height: 1.4;
    word-break: break-word;
}

.sync-monitor-container .table-last-synced {
    width: 180px;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
}

    .sync-monitor-container .table-last-synced:hover {
        color: #475569;
        transform: scale(1.02);
    }

.sync-monitor-container .table-actions {
    width: 120px;
    display: flex;
    justify-content: center;
}

.sync-monitor-container .btn-sync {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

    .sync-monitor-container .btn-sync::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.6s ease;
    }

    .sync-monitor-container .btn-sync:hover:not(:disabled) {
        background: linear-gradient(135deg, #2563eb, #1e40af);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    }

        .sync-monitor-container .btn-sync:hover:not(:disabled)::before {
            left: 100%;
        }

    .sync-monitor-container .btn-sync:disabled {
        background: linear-gradient(135deg, #cbd5e1, #94a3b8);
        cursor: not-allowed;
        opacity: 0.6;
    }

/* Pagination Section */
.sync-monitor-container .pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
}

.sync-monitor-container .btn-pagination {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 80px;
}

    .sync-monitor-container .btn-pagination:hover:not(:disabled) {
        background: linear-gradient(135deg, #2563eb, #1e40af);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    }

    .sync-monitor-container .btn-pagination:disabled {
        background: linear-gradient(135deg, #cbd5e1, #94a3b8);
        cursor: not-allowed;
        opacity: 0.6;
    }

.sync-monitor-container .pagination-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin: 0 1rem;
}

.sync-monitor-container .page-numbers {
    display: flex;
    gap: 0.25rem;
}

.sync-monitor-container .btn-page-number {
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #475569;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 40px;
}

    .sync-monitor-container .btn-page-number:hover {
        background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
        transform: translateY(-1px);
    }

    .sync-monitor-container .btn-page-number.active {
        background: linear-gradient(135deg, #4ade80, #22c55e);
        color: white;
        font-weight: 600;
        box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
    }

.sync-monitor-container .page-info-text {
    font-size: 0.85rem;
    color: #666;
    text-align: center;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .sync-monitor-container .pagination-container {
        flex-direction: column;
        gap: 1rem;
    }

    .sync-monitor-container .pagination-info {
        margin: 0;
    }

    .sync-monitor-container .btn-pagination {
        min-width: 60px;
        font-size: 0.8rem;
    }
}

/* Loading States */
.sync-monitor-container .loading {
    text-align: center;
    padding: 4rem;
    color: #666;
}

.sync-monitor-container .spinner {
    border: 4px solid rgba(59, 130, 246, 0.1);
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.sync-monitor-container .no-results {
    text-align: center;
    padding: 4rem;
    color: #666;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
}

/* Debug Log Section */
.sync-monitor-container .debug-log-section {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    color: #e0e0e0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

    .sync-monitor-container .debug-log-section h2 {
        margin-top: 0;
        margin-bottom: 1.5rem;
        color: #fff;
        font-weight: 600;
    }

.sync-monitor-container .debug-log {
    background: rgba(13, 13, 13, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.8;
    backdrop-filter: blur(5px);
}

.sync-monitor-container .log-empty {
    text-align: center;
    color: #666;
    font-style: italic;
}

.sync-monitor-container .log-entry {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

    .sync-monitor-container .log-entry:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }

    .sync-monitor-container .log-entry.log-info {
        background-color: rgba(59, 130, 246, 0.1);
        border-left-color: #3b82f6;
        color: #93c5fd;
    }

    .sync-monitor-container .log-entry.log-warning {
        background-color: rgba(245, 158, 11, 0.1);
        border-left-color: #f59e0b;
        color: #fbbf24;
    }

    .sync-monitor-container .log-entry.log-error {
        background-color: rgba(239, 68, 68, 0.1);
        border-left-color: #ef4444;
        color: #fca5a5;
    }

/* Enhanced Scrollbar Styling */
.sync-monitor-container .debug-log::-webkit-scrollbar {
    width: 8px;
}

.sync-monitor-container .debug-log::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.sync-monitor-container .debug-log::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    transition: background 0.3s ease;
}

    .sync-monitor-container .debug-log::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.3);
    }

/* Responsive Design */
@media (max-width: 768px) {
    .sync-monitor-container {
        padding: 1rem;
    }

        .sync-monitor-container .header h1 {
            font-size: 2rem;
        }

        .sync-monitor-container .stats-container {
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 1rem;
        }

        .sync-monitor-container .stat-card {
            min-height: 100px;
            padding: 1rem 0.75rem;
        }

        .sync-monitor-container .stat-value {
            font-size: 1.4rem;
        }

        .sync-monitor-container .stat-label {
            font-size: 0.8rem;
            margin-bottom: 0.5rem;
        }

        .sync-monitor-container .controls-container {
            flex-direction: column;
            align-items: stretch;
        }

        .sync-monitor-container .search-box {
            min-width: 100%;
        }

        /* Hide header on mobile, stack row items */
        .sync-monitor-container .table-header {
            display: none;
        }

        .sync-monitor-container .table-item {
            flex-wrap: wrap;
            padding: 1rem;
            gap: 0.75rem;
        }

        .sync-monitor-container .table-status {
            width: 40px;
        }

        .sync-monitor-container .table-info {
            flex: 1;
            min-width: calc(100% - 60px);
            order: 1;
        }

        .sync-monitor-container .table-last-synced {
            width: 100%;
            text-align: left;
            order: 2;
            padding-left: 40px;
            font-size: 0.8rem;
        }

        .sync-monitor-container .table-actions {
            width: 100%;
            order: 3;
            padding-left: 40px;
        }

        .sync-monitor-container .btn-sync {
            width: 100%;
        }
}

@media (max-width: 480px) {
    .sync-monitor-container .table-item {
        padding: 0.875rem;
    }

    .sync-monitor-container .table-name {
        font-size: 0.9rem;
    }
}

/* Animation for initial load */
.sync-monitor-container .table-item {
    animation: fadeIn 0.4s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Subtle pulse animation for live time updates */
@keyframes liveTimePulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

.sync-monitor-container .table-last-synced {
    animation: liveTimePulse 45s infinite ease-in-out;
}

/* Stagger animation for table items */
.sync-monitor-container .table-item:nth-child(2) {
    animation-delay: 0.02s;
}

.sync-monitor-container .table-item:nth-child(3) {
    animation-delay: 0.04s;
}

.sync-monitor-container .table-item:nth-child(4) {
    animation-delay: 0.06s;
}

.sync-monitor-container .table-item:nth-child(5) {
    animation-delay: 0.08s;
}

.sync-monitor-container .table-item:nth-child(6) {
    animation-delay: 0.1s;
}

.sync-monitor-container .table-item:nth-child(7) {
    animation-delay: 0.12s;
}

.sync-monitor-container .table-item:nth-child(8) {
    animation-delay: 0.14s;
}

.sync-monitor-container .table-item:nth-child(9) {
    animation-delay: 0.16s;
}

.sync-monitor-container .table-item:nth-child(10) {
    animation-delay: 0.18s;
}
