/* VPS Compare - Custom Styles */

/* Tailwind Primary Color Override - IMPORTANT! Must override Tailwind gradients */
/* Override gradient backgrounds for elements with primary color classes */
a[class*="from-primary-600"][class*="to-primary-700"],
button[class*="from-primary-600"][class*="to-primary-700"],
[class*="from-primary-600"][class*="to-primary-700"].bg-gradient-to-r {
    background-image: linear-gradient(to right, #1c5376, #1a4a6e) !important;
}

a[class*="from-primary-600"][class*="to-primary-700"]:hover,
button[class*="from-primary-600"][class*="to-primary-700"]:hover,
[class*="from-primary-600"][class*="to-primary-700"].bg-gradient-to-r:hover {
    background-image: linear-gradient(to right, #1a4a6e, #18405f) !important;
}

a[class*="from-primary-700"][class*="to-primary-800"],
button[class*="from-primary-700"][class*="to-primary-800"],
[class*="from-primary-700"][class*="to-primary-800"].bg-gradient-to-r {
    background-image: linear-gradient(to right, #1a4a6e, #18405f) !important;
}

a[class*="from-primary-500"][class*="to-primary-700"],
button[class*="from-primary-500"][class*="to-primary-700"],
[class*="from-primary-500"][class*="to-primary-700"].bg-gradient-to-r {
    background-image: linear-gradient(to right, #1f5a84, #1a4a6e) !important;
}

/* Banner/section gradients */
section[class*="from-primary-600"][class*="to-primary-800"],
div[class*="from-primary-600"][class*="to-primary-800"] {
    background-image: linear-gradient(to bottom right, #1c5376, #18405f) !important;
}

section[class*="from-primary-500"][class*="to-primary-700"],
div[class*="from-primary-500"][class*="to-primary-700"] {
    background-image: linear-gradient(to bottom right, #1f5a84, #1a4a6e) !important;
}


/* 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 */
    background: #475569;
}

    background: #64748b;
}

    background: rgba(51, 65, 85, 0.3);
}

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

    scrollbar-color: #475569 rgba(51, 65, 85, 0.3);
}

/* Custom checkbox styling removed - using improved version below */

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

    background: #1e293b;
    color: #94a3b8;
    border-bottom-color: #334155;
}

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

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

    background-color: #334155;
}

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

    background-color: rgba(59, 130, 246, 0.15);
}

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

.sortable:hover {
    color: #1f5a84;
}

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

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

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

    background-color: rgba(14, 165, 233, 0.2);
    color: #38bdf8;
}

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

    background-color: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

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

    background-color: rgba(31, 90, 132, 0.2);
    color: #2d6a93;
}

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

    background-color: #334155;
    color: #94a3b8;
    border-color: #475569;
}

.feature-tag.active {
    background-color: #d0e8f5;
    color: #184a6e;
    border-color: #4a8ac2;
}

    background-color: rgba(31, 90, 132, 0.2);
    color: #2d6a93;
    border-color: #1f5a84;
}

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

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

    background-color: #334155;
    color: #94a3b8;
    border-color: #475569;
}

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

.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, #e8f4f9 0%, #d0e8f5 100%);
    border: 1px solid #4a8ac2;
}

    background: linear-gradient(135deg, rgba(31, 90, 132, 0.1) 0%, rgba(31, 90, 132, 0.05) 100%);
    border-color: rgba(31, 90, 132, 0.3);
}

.stat-card.highlight {
    background: linear-gradient(135deg, #1f5a84 0%, #184a6e 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;
}

    background-color: rgba(31, 90, 132, 0.2);
}

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

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

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

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

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

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

/* ============================================
   Comparison Checkbox Column
   ============================================ */

.col-compare {
    width: 60px;
    text-align: center;
    padding: 0.75rem;
    vertical-align: middle;
}

.compare-checkbox {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 24px;
    height: 24px;
    border: 2.5px solid #cbd5e1;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.compare-checkbox:hover {
    border-color: #1f5a84;
    transform: scale(1.08);
    box-shadow: 0 0 0 4px rgba(31, 90, 132, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.compare-checkbox:checked {
    background: linear-gradient(135deg, #1f5a84 0%, #184a6e 100%);
    border-color: #1f5a84;
    box-shadow: 0 0 0 4px rgba(31, 90, 132, 0.15), 0 2px 6px rgba(0, 0, 0, 0.15);
    animation: checkboxPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkboxPop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

.compare-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
    animation: checkmarkDraw 0.2s ease-out 0.1s backwards;
}

@keyframes checkmarkDraw {
    0% {
        height: 0;
        opacity: 0;
    }
    100% {
        height: 12px;
        opacity: 1;
    }
}

.compare-checkbox:focus {
    outline: 3px solid #1f5a84;
    outline-offset: 2px;
}

.compare-checkbox:active {
    transform: scale(0.95);
}

/* Selected row styling */
tr.selected {
    background-color: #eff6ff !important;
    border-left: 3px solid #1f5a84;
}

tr.selected:hover {
    background-color: #dbeafe !important;
}

/* Responsive adjustments for comparison column */
@media (max-width: 768px) {
    .col-compare {
        width: 50px;
        padding: 0.5rem;
    }

    .compare-checkbox {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .col-compare {
        width: 40px;
        padding: 0.375rem;
    }

    .compare-checkbox {
        width: 14px;
        height: 14px;
    }
}

/* ============================================
   Compare Feature - Navigation Badges
   ============================================ */

/* Compare Bar (above table) */
.compare-bar {
    background: white;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #1f5a84;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease-out;
}

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

.compare-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.compare-bar-text {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    font-weight: 500;
    color: #334155;
}

.compare-bar-icon {
    font-size: 1.5rem;
}

#compare-bar-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 10px;
    background: #1f5a84;
    color: white;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
}

.compare-bar-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.compare-bar-btn-clear {
    padding: 11px 20px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.compare-bar-btn-clear:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #475569;
}

.compare-bar-btn-clear:active {
    background: #e2e8f0;
}

.compare-bar-btn-compare {
    padding: 12px 24px;
    background: linear-gradient(135deg, #1f5a84 0%, #184a6e 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(31, 90, 132, 0.25);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.compare-bar-btn-compare:hover:not(:disabled) {
    background: linear-gradient(135deg, #184a6e 0%, #143a58 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(31, 90, 132, 0.4);
}

.compare-bar-btn-compare:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(31, 90, 132, 0.3);
}

.compare-bar-btn-compare:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    text-shadow: none;
}

@media (max-width: 768px) {
    .compare-bar-content {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .compare-bar-text {
        justify-content: center;
    }

    .compare-bar-actions {
        flex-direction: column;
    }

    .compare-bar-btn-clear,
    .compare-bar-btn-compare {
        width: 100%;
        padding: 10px;
    }
}

.nav-compare-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    color: var(--text);
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s;
    position: relative;
}

.nav-compare-link:hover {
    background: var(--bg-secondary);
}

.compare-icon {
    font-size: 1.2rem;
}

.compare-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #1f5a84;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 10px;
}

.nav-compare-link-mobile {
    display: none;
}

.compare-badge-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: #1f5a84;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 9px;
}

/* Mobile nav badge */
@media (max-width: 768px) {
    .nav-compare-link {
        display: none;
    }

    .nav-compare-link-mobile {
        display: flex;
        align-items: center;
        padding: 8px;
    }
}

/* ============================================
   Compare Feature - Floating Button
   ============================================ */

.compare-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: slideUpBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideUpBounce {
    0% {
        transform: translateY(100px) scale(0.9);
        opacity: 0;
    }
    60% {
        transform: translateY(-5px) scale(1.02);
        opacity: 1;
    }
    80% {
        transform: translateY(2px) scale(0.99);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

/* Pulse animation to draw attention */
.compare-float.show-pulse {
    animation: slideUpBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55),
               pulse 2s ease-in-out 0.5s 2;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 4px 20px rgba(31, 90, 132, 0.4);
    }
}

.compare-float-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #1f5a84;
    color: white;
    border: none;
    border-radius: 0;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.compare-float-btn:hover {
    background: #184a6e;
}

.compare-float-icon {
    font-size: 1.2rem;
}

.compare-float-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.compare-float-label {
    font-size: 0.9rem;
}

.compare-float-count {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
}

.compare-float-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 100%;
    min-height: 44px;
    background: #f1f5f9;
    border: none;
    border-left: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s;
}

.compare-float-clear:hover {
    background: #e2e8f0;
    color: #ef4444;
}

/* Mobile floating button */
@media (max-width: 768px) {
    .compare-float {
        bottom: 16px;
        right: 16px;
    }

    .compare-float-btn {
        padding: 10px 16px;
        font-size: 0.875rem;
    }

    .compare-float-icon {
        font-size: 1rem;
    }

    .compare-float-label {
        font-size: 0.8rem;
    }

    .compare-float-count {
        min-width: 20px;
        height: 20px;
        font-size: 0.8rem;
    }

    .compare-float-clear {
        width: 38px;
        min-height: 38px;
        font-size: 1.1rem;
    }
}

/* Toast notification */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    font-size: 0.9rem;
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
}

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

.toast.error {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.toast.success {
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
    color: #166534;
}

@media (max-width: 768px) {
    .toast {
        top: 16px;
        right: 16px;
        left: 16px;
        font-size: 0.875rem;
    }
}
