/* VPS Compare - Custom Styles */

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Custom checkbox for compare */
.compare-checkbox {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #94a3b8;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.compare-checkbox:hover {
    border-color: #3b82f6;
}

.compare-checkbox:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.compare-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.dark .compare-checkbox {
    border-color: #475569;
}

/* Table styles */
.plans-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.plans-table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8fafc;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #64748b;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.dark .plans-table th {
    background: #1e293b;
    color: #94a3b8;
    border-bottom-color: #334155;
}

.plans-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.dark .plans-table td {
    border-bottom-color: #334155;
}

/* Provider logo in table */
.provider-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
    border-radius: 4px;
    flex-shrink: 0;
}

.provider-cell-inner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.plans-table tbody tr {
    transition: background-color 0.15s;
}

.plans-table tbody tr:hover {
    background-color: #f1f5f9;
}

.dark .plans-table tbody tr:hover {
    background-color: #334155;
}

/* Selected row for compare */
.plans-table tbody tr.selected {
    background-color: #dbeafe;
}

.dark .plans-table tbody tr.selected {
    background-color: rgba(59, 130, 246, 0.15);
}

/* Sortable headers */
.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable:hover {
    color: #3b82f6;
}

.sort-icon {
    display: inline-block;
    margin-left: 0.25rem;
    opacity: 0.4;
}

.sort-icon.active {
    opacity: 1;
    color: #3b82f6;
}

/* Category badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-category {
    background-color: #e0f2fe;
    color: #0369a1;
}

.dark .badge-category {
    background-color: rgba(14, 165, 233, 0.2);
    color: #38bdf8;
}

.badge-linux {
    background-color: #dcfce7;
    color: #166534;
}

.dark .badge-linux {
    background-color: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.badge-windows {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.dark .badge-windows {
    background-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

/* Feature tags */
.feature-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 500;
    background-color: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.dark .feature-tag {
    background-color: #334155;
    color: #94a3b8;
    border-color: #475569;
}

.feature-tag.active {
    background-color: #dbeafe;
    color: #2563eb;
    border-color: #93c5fd;
}

.dark .feature-tag.active {
    background-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border-color: #3b82f6;
}

/* Price styling */
.price {
    font-weight: 700;
    color: #059669;
}

.dark .price {
    color: #34d399;
}

.price-secondary {
    font-size: 0.75rem;
    color: #64748b;
}

/* Quick filters */
.quick-filter {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
}

.dark .quick-filter {
    background-color: #334155;
    color: #94a3b8;
    border-color: #475569;
}

.quick-filter:hover,
.quick-filter.active {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.quick-filter .count {
    margin-left: 0.5rem;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
}

/* Stats cards */
.stat-card {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
}

.dark .stat-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-color: rgba(59, 130, 246, 0.3);
}

.stat-card.highlight {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
}

/* Filter panel animation */
.filter-panel {
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    overflow: hidden;
}

.filter-panel.collapsed {
    max-height: 0;
    opacity: 0;
}

/* Compare page - highlight best values */
.best-value {
    position: relative;
    background-color: #dbeafe;
    font-weight: 600;
}

.dark .best-value {
    background-color: rgba(59, 130, 246, 0.2);
}

.best-value::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background-color: #3b82f6;
}

/* Provider cards */
.provider-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.provider-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.dark .provider-card:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Status indicators */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.recent {
    background-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.status-dot.outdated {
    background-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.dark .skeleton {
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    background-color: #1e293b;
    color: white;
    font-weight: 500;
    z-index: 100;
    animation: slideIn 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.toast.success {
    background-color: #059669;
}

.toast.error {
    background-color: #dc2626;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    .plans-table th {
        background: white !important;
        color: black !important;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Comparison table on mobile - improve horizontal scrolling */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .overflow-x-auto table {
        min-width: auto;
    }

    .overflow-x-auto table th,
    .overflow-x-auto table td {
        min-width: 150px;
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }

    .overflow-x-auto table th:first-child,
    .overflow-x-auto table td:first-child {
        position: sticky;
        left: 0;
        z-index: 10;
        background: white;
    }

    .dark .overflow-x-auto table th:first-child,
    .dark .overflow-x-auto table td:first-child {
        background: rgb(30 41 59); /* slate-800 */
    }

    .overflow-x-auto table th:first-child {
        z-index: 20;
    }

    /* Provider cards */
    .provider-card {
        padding: 1rem;
    }

    .provider-card h2 {
        font-size: 1.125rem;
    }

    /* Best value indicator */
    .best-value {
        font-weight: 600;
    }

    .best-value::after {
        width: 2px;
    }

    /* Badge sizes */
    .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }

    /* Feature icons in comparison */
    .overflow-x-auto svg {
        width: 1rem;
        height: 1rem;
    }

    /* Scrollbar styling for mobile */
    .overflow-x-auto::-webkit-scrollbar {
        height: 4px;
    }

    .overflow-x-auto::-webkit-scrollbar-track {
        background: transparent;
    }

    .overflow-x-auto::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 2px;
    }

    .dark .overflow-x-auto::-webkit-scrollbar-thumb {
        background: #475569;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .overflow-x-auto table th,
    .overflow-x-auto table td {
        min-width: 120px;
        padding: 0.5rem 0.375rem;
        font-size: 0.8rem;
    }

    .provider-card {
        padding: 0.75rem;
    }

    .badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }
}
