/* VPN Bot Mini App - Modern UI */
:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --accent: #667eea;
    --accent-secondary: #764ba2;
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #ef4444;
    --border: rgba(255, 255, 255, 0.1);
    --radius: 16px;
    --radius-sm: 12px;
}

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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* Agreement Screen */
.agreement-screen {
    padding: 20px 0;
}

.agreement-screen .hero {
    margin-bottom: 24px;
}

.agreement-screen .card {
    text-align: center;
}

.agreement-screen .card h3 {
    margin-bottom: 12px;
}

.agreement-screen .card p {
    margin-bottom: 0;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 32px;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 16px;
}

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

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

.hidden { display: none !important; }

/* Glass Effect */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 40px 20px;
}

.hero-icon {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.hero-icon svg {
    width: 80px;
    height: 80px;
}

/* Inline icons */
.icon-inline {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-right: 6px;
    display: inline-block;
}

.icon-sm {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 6px;
    display: inline-block;
}

.hero h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Cards */
.card {
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
}

.card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-gradient {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    color: white;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-card);
}

/* Screen Header */
.screen-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.screen-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.back-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
}

.screen-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Operator Grid */
.operator-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.operator-btn {
    padding: 20px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.operator-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--accent);
}

/* Platform Cards */
.platform-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.platform-card {
    padding: 32px 24px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.platform-card:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--accent);
}

.platform-icon {
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
}

.platform-icon svg {
    stroke: var(--text-primary);
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

.logo-icon {
    display: flex;
    align-items: center;
}

.logo-icon svg {
    width: 28px;
    height: 28px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
}

/* Subscription Card */
.sub-card {
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.sub-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
}

.status-dot.trial { background: var(--warning); }
.status-dot.expired { background: var(--danger); }

.status-text {
    font-size: 14px;
    font-weight: 500;
}

.sub-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
}

.sub-operator {
    font-size: 24px;
    font-weight: 700;
}

.sub-expiry {
    text-align: right;
}

.expiry-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
}

.expiry-value {
    font-size: 14px;
    font-weight: 500;
}

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

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

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

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.quick-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-btn.primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    border: none;
}

.quick-btn:hover {
    transform: translateY(-2px);
}

.quick-icon {
    display: flex;
    align-items: center;
}

.quick-icon svg {
    stroke: currentColor;
}

/* Menu Section */
.menu-section {
    margin-bottom: 24px;
}

.menu-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-left: 4px;
}

.menu-list {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 16px;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.menu-icon {
    display: flex;
    align-items: center;
    margin-right: 12px;
}

.menu-icon svg {
    stroke: var(--accent);
}

.menu-text {
    flex: 1;
    font-size: 15px;
}

.menu-chevron {
    display: flex;
    align-items: center;
}

.menu-chevron svg {
    stroke: var(--text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.empty-icon svg {
    stroke: var(--accent);
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}

.modal-overlay.active {
    display: flex;
}

/* Block body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    background: var(--bg-secondary);
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-card);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn svg {
    stroke: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

.modal-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Setup Buttons */
.setup-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.setup-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--accent);
}

.setup-btn.happ {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-color: var(--accent);
}

.setup-icon {
    display: flex;
    align-items: center;
}

.setup-icon svg {
    stroke: var(--accent);
}

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

.setup-name {
    font-size: 16px;
    font-weight: 600;
}

.setup-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* QR Wrapper */
.qr-wrapper {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: white;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.qr-wrapper img {
    max-width: 200px;
}

.copy-btn {
    width: 100%;
}

/* Plans List */
.plans-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plan-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.plan-card:hover {
    border-color: var(--accent);
}

.plan-card.popular {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.plan-info h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.plan-info span {
    font-size: 12px;
    color: var(--text-secondary);
}

.plan-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

/* Operator List */
.operator-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.operator-option {
    display: flex;
    align-items: center;
    padding: 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.operator-option:hover {
    border-color: var(--accent);
}

.operator-option.active {
    border-color: var(--success);
    background: rgba(74, 222, 128, 0.1);
}

/* Instruction Steps */
.instruction-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.step {
    display: flex;
    align-items: center;
    gap: 16px;
}

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.step-text {
    font-size: 14px;
}

/* Download Links */
.download-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 12px;
}

.download-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Icon helpers */
.op-icon, .dl-icon, .check-icon {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-right: 8px;
}

.op-icon svg, .dl-icon svg {
    stroke: var(--accent);
}

.check-icon {
    margin-left: auto;
    margin-right: 0;
}

.check-icon svg {
    stroke: var(--success);
}

.operator-option {
    display: flex;
    align-items: center;
}

.operator-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(74, 222, 128, 0.95);
    color: #0f0f1a;
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(74, 222, 128, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-notification .toast-icon svg {
    stroke: #0f0f1a;
    width: 18px;
    height: 18px;
}

/* Button Spinner */
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

button:disabled, .btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Instruction Footer */
.instruction-footer {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 2px solid var(--accent);
    text-align: center;
    background: linear-gradient(180deg, rgba(102, 126, 234, 0.05) 0%, transparent 100%);
    border-radius: 0 0 12px 12px;
    margin-left: -20px;
    margin-right: -20px;
    margin-bottom: -20px;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
}

.instruction-footer .success-text {
    color: var(--success);
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 12px;
}

.instruction-footer .help-text {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0;
}
