/* Modern Proxy Dashboard - Glassmorphic Design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #070A12;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);
    --accent-primary: #8b5cf6;
    --accent-secondary: #10b981;
    --accent-danger: #ef4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

/* Ambient background gradients */
body::before {
    content: '';
    position: fixed;
    top: -6rem;
    left: 2.5rem;
    width: 18rem;
    height: 18rem;
    border-radius: 50%;
    background: rgba(217, 70, 239, 0.2);
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: 6rem;
    right: 2.5rem;
    width: 18rem;
    height: 18rem;
    border-radius: 50%;
    background: rgba(6, 182, 212, 0.15);
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

.ambient-blob {
    position: fixed;
    bottom: 2.5rem;
    left: 33%;
    width: 20rem;
    height: 20rem;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.15);
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

/* Top Navigation */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(24px);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.nav-title-wrap {
    line-height: 1.2;
}

.nav-title {
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.nav-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    border: none;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: white;
    color: black;
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.9);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Container */
.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* Auth View - Simplified */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 4rem);
}

.auth-card {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: 1.25rem;
    padding: 2rem;
    width: 100%;
    max-width: 420px;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-header p {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem;
    border-radius: 0.75rem;
}

.tab-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.tab-btn.active {
    background: white;
    color: black;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    text-align: center;
    display: none;
    font-size: 0.875rem;
}

.form-message.success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    display: block;
}

.form-message.error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    display: block;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-title-section h1 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.dashboard-title-section p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.dashboard-actions {
    display: flex;
    gap: 0.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 1rem;
}

.stat-card-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.stat-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Subscription Card */
.subscription-card {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.subscription-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.subscription-info p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.subscription-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-active {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-paused {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-expired {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.usage-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.usage-summary-label {
    color: var(--text-secondary);
}

.usage-summary-value {
    color: var(--text-primary);
}

.progress-bar {
    height: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.25rem;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.3s ease;
}

.subscription-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.subscription-tip {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Controls */
.controls-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.controls-content {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-wrapper {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.625rem 0.75rem 0.625rem 2.5rem;
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.controls-filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

select {
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.view-toggle {
    display: flex;
    gap: 0.25rem;
}

.view-toggle-btn {
    padding: 0.625rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.view-toggle-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

/* Proxies Grid */
.proxies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.75rem;
}

.proxy-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 1rem;
    transition: all 0.3s;
}

.proxy-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

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

.proxy-card-title-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.proxy-card-title-section p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.proxy-url-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.proxy-url-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.proxy-url-text {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: rgba(167, 139, 250, 0.9);
    word-break: break-all;
    line-height: 1.4;
}

.proxy-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
}

.proxy-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.proxy-usage {
    margin-bottom: 0.75rem;
}

.proxy-usage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
}

.proxy-usage-label {
    color: var(--text-secondary);
}

.proxy-usage-value {
    color: var(--text-primary);
}

/* List View */
.proxies-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.proxy-row {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 1rem;
}

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

.proxy-row-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.proxy-row-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.proxy-row-url {
    margin-bottom: 0.75rem;
}

.proxy-row-footer {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0.75rem;
    align-items: end;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .proxies-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .proxy-row-footer {
        grid-template-columns: 1fr;
    }
}

/* Pricing Options */
.pricing-option {
    position: relative;
    display: block;
    cursor: pointer;
}

.pricing-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pricing-option-content {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pricing-option:hover .pricing-option-content {
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.05);
    transform: translateY(-2px);
}

.pricing-option input[type="radio"]:checked + .pricing-option-content,
.pricing-option.selected .pricing-option-content {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(59, 130, 246, 0.1) 100%);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.2);
}

.pricing-option-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.pricing-option-icon {
    font-size: 1.5rem;
}

.pricing-option-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pricing-option-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.pricing-option-features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.pricing-option-features div {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    backdrop-filter: blur(24px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

/* Utility */
.hidden {
    display: none;
}
