/* Meilisearch Table Styles for Provider Pages */

.hidden {
    display: none !important;
}

/* ========== Controls Section ========== */
.plans-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

html.dark .plans-controls {
    background: rgb(30 41 59);
    border-color: rgb(51 65 85);
}

.plans-search {
    flex: 1;
    max-width: 280px;
    position: relative;
}

.plans-search svg {
    position: absolute;
    left: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgb(148 163 184);
    pointer-events: none;
}

.plans-search input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    font-size: 0.875rem;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.5rem;
    background: rgb(248 250 252);
    color: rgb(15 23 42);
    transition: all 0.15s;
}

.plans-search input:focus {
    outline: none;
    border-color: rgb(59 130 246);
    background: white;
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

html.dark .plans-search input {
    background: rgb(15 23 42);
    border-color: rgb(51 65 85);
    color: rgb(241 245 249);
}

html.dark .plans-search input:focus {
    background: rgb(30 41 59);
    border-color: rgb(59 130 246);
}

.plans-stats {
    font-size: 0.8125rem;
    color: rgb(100 116 139);
    white-space: nowrap;
}

.plans-stats strong {
    color: rgb(15 23 42);
    font-weight: 600;
}

html.dark .plans-stats {
    color: rgb(148 163 184);
}

html.dark .plans-stats strong {
    color: rgb(241 245 249);
}

.plans-view-toggle {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: rgb(241 245 249);
    border-radius: 0.5rem;
}

html.dark .plans-view-toggle {
    background: rgb(51 65 85);
}

.view-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    color: rgb(100 116 139);
    cursor: pointer;
    transition: all 0.15s;
}

.view-btn:hover {
    color: rgb(59 130 246);
}

.view-btn.active {
    background: white;
    color: rgb(59 130 246);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

html.dark .view-btn {
    color: rgb(148 163 184);
}

html.dark .view-btn:hover {
    color: rgb(96 165 250);
}

html.dark .view-btn.active {
    background: rgb(30 41 59);
    color: rgb(96 165 250);
}

.plans-sort {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.5rem;
    background: rgb(248 250 252);
    color: rgb(15 23 42);
    cursor: pointer;
}

html.dark .plans-sort {
    background: rgb(15 23 42);
    border-color: rgb(51 65 85);
    color: rgb(241 245 249);
}

/* ========== Table Styles ========== */
.plans-table-wrapper {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

html.dark .plans-table-wrapper {
    background: rgb(30 41 59);
    border-color: rgb(51 65 85);
}

.plans-table {
    width: 100%;
    border-collapse: collapse;
}

.plans-table thead {
    background: rgb(248 250 252);
}

html.dark .plans-table thead {
    background: rgb(15 23 42);
}

.plans-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: rgb(100 116 139);
    border-bottom: 1px solid rgb(226 232 240);
}

html.dark .plans-table th {
    color: rgb(148 163 184);
    border-bottom-color: rgb(51 65 85);
}

.plans-table td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: rgb(51 65 85);
    border-bottom: 1px solid rgb(241 245 249);
}

html.dark .plans-table td {
    color: rgb(203 213 225);
    border-bottom-color: rgb(51 65 85);
}

.plans-table tbody tr:hover {
    background: rgb(248 250 252);
}

html.dark .plans-table tbody tr:hover {
    background: rgb(51 65 85 / 0.3);
}

.plans-table tbody tr:last-child td {
    border-bottom: none;
}

/* ========== Cards Grid ========== */
.plans-cards-wrapper {
    background: rgb(248 250 252);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.75rem;
    padding: 1rem;
}

html.dark .plans-cards-wrapper {
    background: rgb(15 23 42);
    border-color: rgb(51 65 85);
}

.plans-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* ========== Plan Card ========== */
.plan-card {
    background: white;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.2s;
}

.plan-card:hover {
    border-color: rgb(59 130 246);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

html.dark .plan-card {
    background: rgb(30 41 59);
    border-color: rgb(51 65 85);
}

html.dark .plan-card:hover {
    border-color: rgb(59 130 246);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

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

.plan-card-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: rgb(15 23 42);
    line-height: 1.3;
}

html.dark .plan-card-name {
    color: rgb(241 245 249);
}

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

.plan-card-price-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: rgb(16 185 129);
}

html.dark .plan-card-price-value {
    color: rgb(52 211 153);
}

.plan-card-price-period {
    font-size: 0.6875rem;
    color: rgb(100 116 139);
    text-transform: uppercase;
}

html.dark .plan-card-price-period {
    color: rgb(148 163 184);
}

.plan-card-billing {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    background: rgb(236 253 245);
    color: rgb(4 120 87);
    border-radius: 9999px;
}

html.dark .plan-card-billing {
    background: rgb(6 78 59);
    color: rgb(110 231 183);
}

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

.plan-card-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: rgb(248 250 252);
    border-radius: 0.5rem;
}

html.dark .plan-card-specs {
    background: rgb(15 23 42);
}

.plan-card-spec-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgb(100 116 139);
    margin-bottom: 0.125rem;
}

html.dark .plan-card-spec-label {
    color: rgb(148 163 184);
}

.plan-card-spec-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgb(15 23 42);
}

html.dark .plan-card-spec-value {
    color: rgb(241 245 249);
}

.plan-card-action {
    display: block;
    width: 100%;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: white;
    background: rgb(59 130 246);
    border: none;
    border-radius: 0.5rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}

.plan-card-action:hover {
    background: rgb(37 99 235);
}

/* ========== Category Badge ========== */
.category-badge {
    display: inline-block;
    padding: 0.1875rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    border-radius: 0.25rem;
    background: rgb(241 245 249);
    color: rgb(71 85 105);
}

html.dark .category-badge {
    background: rgb(51 65 85);
    color: rgb(203 213 225);
}

.category-badge.cloud-vps {
    background: rgb(219 234 254);
    color: rgb(30 64 175);
}

html.dark .category-badge.cloud-vps {
    background: rgb(30 58 95);
    color: rgb(96 165 250);
}

.category-badge.cpu-optimized {
    background: rgb(254 243 199);
    color: rgb(146 64 14);
}

html.dark .category-badge.cpu-optimized {
    background: rgb(66 32 6);
    color: rgb(251 191 36);
}

.category-badge.memory-optimized {
    background: rgb(209 250 229);
    color: rgb(6 95 70);
}

html.dark .category-badge.memory-optimized {
    background: rgb(6 78 59);
    color: rgb(52 211 153);
}

.category-badge.storage-vps {
    background: rgb(237 233 254);
    color: rgb(91 33 182);
}

html.dark .category-badge.storage-vps {
    background: rgb(46 16 101);
    color: rgb(167 139 250);
}

/* ========== Feature Badge ========== */
.feature-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.375rem;
    font-size: 0.625rem;
    font-weight: 500;
    border-radius: 0.1875rem;
    background: rgb(241 245 249);
    color: rgb(148 163 184);
    opacity: 0.6;
}

.feature-badge.active {
    background: rgb(209 250 229);
    color: rgb(6 95 70);
    opacity: 1;
}

html.dark .feature-badge {
    background: rgb(51 65 85);
    color: rgb(100 116 139);
}

html.dark .feature-badge.active {
    background: rgb(6 78 59);
    color: rgb(52 211 153);
}

/* ========== Pagination ========== */
.plans-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 1rem;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-top: none;
    border-radius: 0 0 0.75rem 0.75rem;
}

html.dark .plans-pagination {
    background: rgb(30 41 59);
    border-color: rgb(51 65 85);
}

.page-btn {
    min-width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.375rem;
    background: white;
    color: rgb(100 116 139);
    cursor: pointer;
    transition: all 0.15s;
}

.page-btn:hover:not(:disabled) {
    border-color: rgb(59 130 246);
    color: rgb(59 130 246);
}

.page-btn.active {
    background: rgb(59 130 246);
    border-color: rgb(59 130 246);
    color: white;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

html.dark .page-btn {
    background: rgb(30 41 59);
    border-color: rgb(51 65 85);
    color: rgb(148 163 184);
}

html.dark .page-btn:hover:not(:disabled) {
    border-color: rgb(59 130 246);
    color: rgb(96 165 250);
}

html.dark .page-btn.active {
    background: rgb(59 130 246);
    border-color: rgb(59 130 246);
    color: white;
}

/* ========== Loading & Empty States ========== */
.plans-state {
    padding: 3rem 1rem;
    text-align: center;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.75rem;
}

html.dark .plans-state {
    background: rgb(30 41 59);
    border-color: rgb(51 65 85);
}

.plans-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.3;
}

.plans-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: rgb(15 23 42);
    margin-bottom: 0.25rem;
}

html.dark .plans-state-title {
    color: rgb(241 245 249);
}

.plans-state-text {
    font-size: 0.875rem;
    color: rgb(100 116 139);
}

html.dark .plans-state-text {
    color: rgb(148 163 184);
}

/* ========== OS Icon ========== */
.os-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    opacity: 0.8;
}

/* ========== Sort Icon ========== */
.sort-icon {
    display: inline-block;
    margin-left: 0.25rem;
    opacity: 0.4;
    font-size: 0.75rem;
}

th[data-sort]:hover .sort-icon {
    opacity: 0.8;
}

/* ========== Spinner ========== */
.spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid rgb(226 232 240);
    border-top-color: rgb(59 130 246);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 0.75rem;
}

html.dark .spinner {
    border-color: rgb(51 65 85);
    border-top-color: rgb(59 130 246);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== Mobile Responsive Styles ========== */
@media (max-width: 768px) {
    .plans-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .plans-search {
        max-width: none;
        width: 100%;
        order: 1;
    }

    .plans-stats {
        order: 2;
        font-size: 0.75rem;
    }

    .plans-view-toggle {
        order: 3;
    }

    .plans-sort {
        order: 4;
        flex: 1;
        min-width: 120px;
    }

    .plans-cards-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .plan-card {
        padding: 0.875rem;
    }

    .plan-card-name {
        font-size: 0.875rem;
    }

    .plan-card-price-value {
        font-size: 1.125rem;
    }

    .plan-card-specs {
        padding: 0.5rem;
        gap: 0.375rem;
    }

    .plan-card-spec-label {
        font-size: 0.5625rem;
    }

    .plan-card-spec-value {
        font-size: 0.75rem;
    }

    /* Table horizontal scroll */
    .plans-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .plans-table {
        min-width: 700px;
    }

    .plans-table th,
    .plans-table td {
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }

    .plans-pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .page-btn {
        min-width: 1.75rem;
        height: 1.75rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .plans-controls {
        padding: 0.5rem;
    }

    .plans-search input {
        padding: 0.4rem 0.5rem 0.4rem 1.75rem;
        font-size: 0.8125rem;
    }

    .plans-search svg {
        left: 0.5rem;
        width: 14px;
        height: 14px;
    }

    .view-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    .plans-sort {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }

    .plan-card-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .plan-card-price {
        text-align: left;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .plan-card-price-value {
        font-size: 1rem;
    }

    .plan-card-price-period {
        font-size: 0.625rem;
    }

    .plan-card-badges {
        gap: 0.25rem;
    }

    .category-badge,
    .feature-badge {
        font-size: 0.5625rem;
        padding: 0.125rem 0.3rem;
    }

    .plans-state {
        padding: 2rem 0.75rem;
    }

    .plans-state-icon {
        font-size: 2rem;
    }

    .plans-state-title {
        font-size: 0.875rem;
    }

    .plans-state-text {
        font-size: 0.8125rem;
    }
}
