:root {
    --primary-blue: #2563eb;
    --secondary-blue: #1e40af;
    --dark-blue: #1e3a8a;
    --light-blue: #3b82f6;
    --accent-blue: #60a5fa;
    --navy: #0f172a;
    --slate: #1e293b;
    --light-slate: #334155;
    --gray: #64748b;
    --light-gray: #94a3b8;
    --white: #ffffff;
    --off-white: #f8fafc;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #1e40af 50%, #1e3a8a 100%);
    --gradient-secondary: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --gradient-accent: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--slate);
    background: var(--off-white);
    font-feature-settings: 'liga' 1, 'kern' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
header {
    background: var(--white);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
}

.logo img {
    width: 40px;
    background: var(--gradient-accent);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--gray);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-blue);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--off-white);
    border-radius: 12px;
    font-size: 0.875rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    font-size: 0.875rem;
}

.logout-btn {
    color: var(--gray);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #fee2e2;
    color: var(--error);
}

/* Main Content */
main {
    padding: 3rem 0;
}

.page-header {
    margin-bottom: 3rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.page-subtitle {
    font-size: 1.125rem;
    color: var(--gray);
    font-weight: 400;
}

.member-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient-primary);
    color: var(--white);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Filters */
.filters {
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
    margin-bottom: 3rem;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.filters-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navy);
}

.clear-filters {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.clear-filters:hover {
    color: var(--secondary-blue);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--slate);
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.875rem;
    background: var(--white);
    transition: border-color 0.3s ease;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.filter-select:hover {
    border-color: var(--accent-blue);
}

/* Plan Categories */
.plan-categories {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.disabled-tab {
    pointer-events: none; 
    opacity: 0.5;         
    cursor: not-allowed;
}

.category-tab {
    padding: 1rem 2rem;
    background: var(--white);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    text-decoration: none;
    color: var(--gray);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    min-width: min-content;
}

.category-tab.active {
    background: var(--gradient-primary);
    color: var(--white);
    border-color: var(--primary-blue);
}

.category-tab:hover:not(.active):not(.disabled-tab) {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

/* Plans Grid */
.plans-section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.section-description {
    color: var(--gray);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 2rem;
}

.plan-card {
    background: var(--white);
    max-width: 500px;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    border: 2px solid #e2e8f0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.plan-card.featured {
    border-color: var(--primary-blue);
    transform: scale(1.02);
}

.plan-card.featured::before {
    content: 'Most Popular';
    position: absolute;
    top: 0;
    right: 0;
    background: var(--gradient-primary);
    color: var(--white);
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-bottom-left-radius: 12px;
}

.plan-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.plan-card.featured:hover {
    transform: scale(1.02) translateY(-8px);
}

.plan-card.unavailable {
    opacity: 0.6;
    background: #f8f9fa;
}

.plan-header {
    text-align: center;
    margin-bottom: 2rem;
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.plan-description {
    color: var(--gray);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.price-amount {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-blue);
}

.price-currency {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-blue);
}

.price-period {
    font-size: 1rem;
    color: var(--gray);
    font-weight: 500;
}

.price-note {
    font-size: 0.75rem;
    color: var(--gray);
    text-align: center;
}

.plan-note {
    font-size: 0.75rem;
    color: var(--warning);
    text-align: center;
    font-style: italic;
    margin-top: 0.5rem;
}

.plan-features {
    list-style: none;
    margin: 2rem 0;
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}

.plan-features li:last-child {
    border-bottom: none;
}

.feature-icon {
    width: 20px;
    height: 20px;
    background: rgb(255, 255, 255);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 0.75rem;
    flex-shrink: 0;
    border: 1px solid #ebebeb;
}

.feature-text {
    flex: 1;
    color: var(--slate);
}

.terms {
    align-items: center;
    text-align: left;
    margin-bottom: 1rem;
}

.terms a {
    display: block;
    width: 100%;
    text-decoration: none;
    color: var(--primary-blue);
    font-size: 12px;
    transition: color 0.3s ease;
    margin-bottom: 10px;
}

.terms a:hover {
    color: var(--secondary-blue);
}

.feature-value {
    font-weight: 600;
    color: var(--navy);
}

.plan-cta {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.plan-cta:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.plan-cta:disabled {
    background: var(--gray);
    cursor: not-allowed;
    opacity: 0.6;
}

.plan-cta.secondary {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.plan-cta.secondary:hover:not(:disabled) {
    background: var(--primary-blue);
    color: var(--white);
}

/* No Results Message */
.no-results-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--gray);
    font-style: italic;
    background: var(--off-white);
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
}

/* Comparison Table */
.comparison-section {
    margin-top: 4rem;
    background: var(--white);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
}

.comparison-header {
    text-align: center;
    margin-bottom: 3rem;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.comparison-table th {
    background: var(--off-white);
    font-weight: 600;
    color: var(--navy);
}

.comparison-table td {
    color: var(--slate);
}

.comparison-table .plan-col {
    text-align: center;
    font-weight: 600;
}

.check-mark {
    color: var(--success);
    font-weight: bold;
}

.cross-mark {
    color: var(--error);
    font-weight: bold;
}

/* Support Section */
.support-card {
    background: var(--gradient-secondary);
    color: var(--white);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    margin-top: 4rem;
}

.support-card h3 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.support-card p {
    opacity: 0.9;
    margin-bottom: 2rem;
    font-size: 1.125rem;
}

.support-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.support-btn {
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.support-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .filters-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .plans-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .user-menu {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .filters {
        padding: 1.5rem;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .plan-categories {
        justify-content: flex-start;
    }
    
    .plans-grid {
        grid-template-columns: 1fr;
    }
    
    .comparison-table {
        font-size: 0.75rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.5rem;
    }
    
    .support-actions {
        flex-direction: column;
    }
}

/* Loading and Animation States */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Filter Animation */
.plan-card {
    transition: opacity 0.3s ease, transform 0.3s ease, display 0.3s ease;
}

.plan-card.filtering {
    opacity: 0;
    transform: translateY(20px);
}

/* Smooth transitions for filter changes */
@media (prefers-reduced-motion: no-preference) {
    .plan-card {
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .plan-card,
    .category-tab,
    .filter-select,
    .plan-cta,
    .support-btn {
        transition: none;
    }
    
    .fade-in {
        transition: none;
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus states for better accessibility */
.filter-select:focus-visible,
.category-tab:focus-visible,
.plan-cta:focus-visible,
.support-btn:focus-visible,
.clear-filters:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .plan-card {
        border-width: 3px;
    }
    
    .plan-card.featured {
        border-width: 4px;
    }
    
    .filter-select {
        border-width: 3px;
    }
}