/* VPS Compare - Custom Styles */

/* Scrollbar - Light Mode */
::-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;
}

/* Scrollbar - Dark Mode */
html.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

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

html.dark ::-webkit-scrollbar-track {
    background: rgba(51, 65, 85, 0.3);
}

/* Firefox scrollbar support */
* {
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 transparent;
}

html.dark * {
    scrollbar-color: #475569 rgba(51, 65, 85, 0.3);
}

/* 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);
}

html.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;
}

html.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;
}

html.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;
}

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

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

html.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;
}

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

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

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

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

html.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;
}

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

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

html.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;
}

html.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;
}

html.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;
}

html.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;
}

html.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);
}

html.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;
}

html.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;
    }
}

/* ========== Affiliate Disclosure ========== */
.affiliate-disclosure {
    background: var(--bg-secondary, #f8fafc);
    border-top: 1px solid var(--border-color, #e2e8f0);
    padding: 1.5rem 0;
    margin-top: 2rem;
}

[data-theme="dark"] .affiliate-disclosure,
.dark .affiliate-disclosure {
    background: rgba(30, 41, 59, 0.5);
    border-color: #334155;
}

.affiliate-disclosure .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.affiliate-disclosure p {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    line-height: 1.6;
    margin: 0;
}

.affiliate-disclosure .affiliate-icon {
    color: var(--accent-color, #3b82f6);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.3;
    flex-shrink: 0;
}

/* ========== Plan Cards (Equal Height) ========== */
.cards-grid,
.plans-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.plan-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

html.dark .plan-card {
    background: #1e293b;
    border-color: #334155;
}

.plan-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

.plan-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.plan-card-name {
    font-weight: 600;
    color: var(--text, #1e293b);
    font-size: 0.9375rem;
    line-height: 1.3;
    word-break: break-word;
}

html.dark .plan-card-name {
    color: #f1f5f9;
}

.plan-card-price {
    text-align: right;
    flex-shrink: 0;
}

.plan-card-price-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #22c55e;
}

.plan-card-price-period {
    font-size: 0.75rem;
    color: #64748b;
}

.plan-card-billing {
    font-size: 0.6875rem;
    color: #64748b;
    opacity: 0.8;
}

.plan-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
}

.plan-card-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    flex-grow: 1;
}

html.dark .plan-card-specs {
    background: rgba(51, 65, 85, 0.5);
}

.plan-card-spec-label {
    font-size: 0.6875rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.plan-card-spec-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text, #1e293b);
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

html.dark .plan-card-spec-value {
    color: #f1f5f9;
}

.plan-card-action {
    display: block;
    width: 100%;
    padding: 0.625rem 1rem;
    background: #3b82f6;
    color: white;
    text-align: center;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
    margin-top: auto;
}

.plan-card-action:hover {
    background: #2563eb;
}

@media (max-width: 640px) {
    .cards-grid,
    .plans-cards-grid {
        grid-template-columns: 1fr;
    }

    .plan-card {
        padding: 1rem;
    }
}
