:root {
    --bg-main: #F5F7FA;
    --bg-surface: #FFFFFF;
    --bg-surface-hover: #F8FAFC;
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-family: 'Inter', sans-serif;
    --tag-unlimited: #D97706; /* orange */
    --tag-data: #EA580C; /* darker orange */
    --tag-recommended: #2563EB; /* blue */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

/* App Container */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* Header */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    background: var(--bg-surface);
    padding: 24px;
    border-radius: var(--radius-md);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1F2937;
}

.badge {
    background: #DBEAFE;
    color: var(--primary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Search Box */
.search-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-container input,
.search-container .form-select {
    background: #F9FAFB;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    width: 220px;
    font-size: 0.95rem;
    transition: all 0.2s;
    outline: none;
    font-family: inherit;
    flex-shrink: 1;
}

.search-container input:focus,
.search-container .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: #FFF;
}

.search-container button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-container button:hover {
    background: var(--primary-hover);
}

/* User Info Bar */
.user-info-bar {
    display: flex;
    gap: 32px;
    background: var(--bg-surface);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 4px;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Filters (Horizontal Chips) */
.filters-row {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-chips {
    display: flex;
    gap: 8px;
}

.chip {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    white-space: nowrap;
}

.chip:hover {
    background: var(--bg-surface-hover);
    border-color: #D1D5DB;
}

.chip.active {
    background: #EFF6FF;
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 500;
}

/* Tabs Container */
.tabs-container {
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    position: relative;
    background: var(--bg-surface);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: 0 12px;
}

.tabs-scroll-wrapper {
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.tabs-list {
    display: flex;
    white-space: nowrap;
    position: relative;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 16px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.3s;
    position: relative;
    z-index: 1;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary);
}

.tabs-indicator {
    position: absolute;
    bottom: -1px;
    height: 3px;
    background-color: var(--primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    border-radius: 3px 3px 0 0;
}

/* Plans Grid */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Tablet */
@media (max-width: 1024px) {
    .plans-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .top-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .plans-grid {
        grid-template-columns: 1fr;
    }
    
    .top-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .search-container {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .search-container input,
    .search-container .form-select {
        width: 100%;
        max-width: none;
    }

    .search-container button {
        width: 100%;
        justify-content: center;
    }
    
    .main-content {
        padding: 16px;
    }

    .user-info-bar {
        flex-wrap: wrap;
        gap: 16px;
    }
}

.plan-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.plan-card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.06);
    border-color: #D1D5DB;
}


.plan-meta-new {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
    margin-top: 12px;
}

.meta-item-new {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.meta-val-new {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.1rem;
    margin-top: 4px;
}


.ott-row-new {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-grow: 1;
}

.ott-icon-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: contain;
    background-color: #F3F4F6;
    border: 1px solid #E5E7EB;
}


.meta-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}


.plan-footer-new {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 4px;
}

.plan-price-new {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.recharge-btn {
    background: #111827;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.recharge-btn:hover {
    background: #374151;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.2s;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-banner {
    background: #FEF3C7;
    color: #92400E;
    text-align: center;
    padding: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.modal-close {
    position: absolute;
    top: 40px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
}

.op-logo {
    width: 48px;
    height: 48px;
    background: #F3F4F6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary);
}

.op-details h2 {
    font-size: 1rem;
    font-weight: 700;
}

.op-details p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.modal-body {
    padding: 24px;
}

.modal-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-meta-item {
    display: flex;
    flex-direction: column;
}

.modal-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.plan-desc-new {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 12px;
}

.more-link {
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
}

.ott-row-new {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.ott-icon-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.plan-divider-new {
    border: none;
    border-top: 1px solid #E5E7EB;
    margin: 16px 0;
}

.modal-benefits h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.benefit-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.benefit-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #F3F4F6;
    flex-shrink: 0;
}

.benefit-text h4 {
    font-size: 0.85rem;
    font-weight: 600;
}

.benefit-text p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: #F9FAFB;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.btn-pay {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-pay:hover {
    background: var(--primary-hover);
}

/* Loading */
.hidden { display: none !important; }

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 64px 0;
    color: var(--text-muted);
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #DBEAFE;
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

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

.error-box {
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    color: #991B1B;
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    text-align: center;
}

/* Filter Modal */
.filter-modal-content {
    max-width: 600px;
    padding: 0;
    position: relative;
    overflow: visible;
}

.modal-close-sm {
    background: #111827;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    position: absolute;
    top: -48px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.filter-modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.filter-modal-body {
    padding: 24px;
}

.filter-section {
    margin-bottom: 24px;
}

.filter-section h3 {
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 16px;
    font-weight: 700;
}

.filter-chips {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.chip-sm {
    background: white;
    border: 1px solid #E5E7EB;
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.chip-sm:hover {
    border-color: #D1D5DB;
    background: #F9FAFB;
}

.chip-sm.active {
    border-color: var(--primary);
    color: var(--primary);
    background: #EFF6FF;
    font-weight: 500;
}

.filter-modal-footer {
    display: flex;
    gap: 16px;
    padding: 24px;
    border-top: 1px solid var(--border);
    background: #F9FAFB;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.btn-clear {
    flex: 1;
    background: white;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
}

.btn-apply {
    flex: 1;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
}

/* Plan Search */
.plan-search-container {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 24px;
    gap: 12px;
    color: var(--text-muted);
}
.plan-search-container input {
    border: none;
    background: transparent;
    font-size: 0.95rem;
    color: var(--text-main);
    width: 100%;
    outline: none;
}
