/* El-Duck VPN Mobile - Clean Version */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: #000;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

.app {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==================== AUTH SCREEN ==================== */
.screen {
    min-height: 100vh;
    display: none;
}

.screen.active {
    display: block;
}

.auth-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    padding-top: calc(20px + env(safe-area-inset-top));
    border-bottom: 1px solid #333;
    background: #000;
}

.auth-header .logo {
    width: 96px;
    height: 51px;
}

.auth-main {
    padding: 40px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 100px);
}

.auth-card {
    width: 100%;
    max-width: 340px;
    padding: 24px 20px;
    border: 1px solid #333;
    backdrop-filter: blur(10px);
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 13px;
    color: #888;
    text-align: center;
    margin-bottom: 24px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    color: #aaa;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: #0a0a0a;
    border: 1px solid #333;
    color: #fff;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: #fff;
}

.form-hint {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.spam-warning {
    font-size: 12px;
    color: #f59e0b;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 8px;
}

.spam-warning strong {
    color: #f59e0b;
}

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: #fff;
    color: #000;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:active {
    background: #ccc;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-link {
    background: none;
    border: none;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.btn-link:hover {
    color: #fff;
}

.auth-footer {
    text-align: center;
    font-size: 12px;
    color: #555;
    margin-top: 20px;
}

/* ==================== HEADER ==================== */
.header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    padding-top: calc(20px + env(safe-area-inset-top));
    border-bottom: 1px solid #333;
    background: #000;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    width: 96px;
    height: 51px;
}

/* ==================== BOTTOM NAVIGATION ==================== */
.navbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    display: flex;
    align-items: center;
    background: #000;
    border-top: 1px solid #333;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: #000;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 12px;
    transition: all 0.2s;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    transition: stroke 0.2s;
}

.nav-item.active {
    color: #fff;
}

.nav-item span {
    font-size: 11px;
    font-weight: 500;
}

.nav-divider {
    width: 1px;
    height: 40px;
    background: #333;
}

/* ==================== MAIN CONTENT ==================== */
.main {
    flex: 1;
    padding: 12px 16px;
    padding-bottom: 80px;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

/* ==================== NO SUBSCRIPTION BANNER ==================== */
.no-subscription-banner {
    border: 1px solid #333;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    backdrop-filter: blur(10px);
}

.banner-icon {
    width: 48px;
    height: 48px;
    filter: invert(1);
    margin-bottom: 16px;
}

.banner-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.banner-text {
    font-size: 13px;
    color: #666;
    margin-bottom: 20px;
}

.btn-subscribe {
    background: #fff;
    color: #000;
    border: none;
    padding: 14px 32px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-subscribe:active {
    background: #ccc;
}

/* ==================== PROFILE ==================== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    backdrop-filter: blur(10px);
    border: 1px solid #333;
    margin-bottom: 14px;
    position: relative;
}

.profile-avatar {
    width: 52px;
    height: 52px;
    border: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background: #0a0a0a;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-email {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.logout-btn:hover {
    color: #fff;
}

/* ==================== BALANCE CARD ==================== */
.balance-card {
    border: 1px solid #333;
    padding: 20px 16px;
    backdrop-filter: blur(10px);
    margin-bottom: 14px;
}

.balance-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.balance-label {
    font-size: 13px;
    color: #888;
}

.refresh-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.refresh-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.refresh-btn:active {
    transform: rotate(360deg);
}

.balance-amount {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.balance-currency {
    font-size: 20px;
    font-weight: 500;
}

.btn-topup {
    width: 100%;
    padding: 14px 24px;
    background: #0a0a0a;
    border: 1px solid #333;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-topup svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.btn-topup:active {
    background: #1a1a1a;
}

/* ==================== SUBSCRIPTION CARD ==================== */
.subscription-card {
    border: 1px solid #333;
    padding: 20px 16px;
    backdrop-filter: blur(10px);
    margin-bottom: 14px;
}

.subscription-title {
    font-size: 14px;
    font-weight: 600;
    color: #888;
    margin-bottom: 12px;
}

.subscription-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #0a0a0a;
    border: 1px solid #333;
    margin-bottom: 12px;
}

.subscription-status .status-icon {
    font-size: 16px;
}

.subscription-status .status-text {
    font-size: 14px;
    color: #888;
}

.subscription-status.active .status-text {
    color: #fff;
}

.btn-subscribe-card {
    width: 100%;
    padding: 14px 24px;
    background: #fff;
    color: #000;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-subscribe-card:active {
    background: #ccc;
}

/* ==================== PROFILE STATS ==================== */
.profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-item {
    border: 1px solid #333;
    padding: 16px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    color: #888;
}

/* ==================== TELEGRAM VERIFICATION ==================== */
.telegram-verification {
    margin-bottom: 16px;
}

.tg-card {
    background: #0a0a0a;
    border: 1px solid #333;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tg-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.tg-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.tg-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tg-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.tg-subtitle {
    font-size: 12px;
    color: #888;
    margin: 0;
}

.tg-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    min-width: 140px;
}

.btn-tg-verify {
    width: 100%;
    padding: 10px 16px;
    background: #4caf50;
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-tg-verify:active {
    opacity: 0.8;
}

.btn-tg-verify.verified {
    background: #333;
    color: #888;
    cursor: default;
}

.tg-code {
    width: 100%;
    font-size: 11px;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    padding: 10px 16px;
    font-family: monospace;
    letter-spacing: 1px;
    text-align: center;
    box-sizing: border-box;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

/* ==================== CARDS GRID ==================== */
.cards-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card {
    border: 1px solid #333;
    padding: 16px;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 14px;
}

.card-flag {
    font-size: 28px;
    flex-shrink: 0;
}

.card-info {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.card-description {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-btn {
    padding: 10px 20px;
    background: #fff;
    color: #000;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.card-btn:active {
    background: #ccc;
}

/* ==================== TOAST ==================== */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #333;
    padding: 12px 20px;
    backdrop-filter: blur(10px);
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    max-width: calc(100% - 32px);
    text-align: center;
}

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

.toast.success {
    border-color: #4caf50;
    color: #4caf50;
}

.toast.error {
    border-color: #f44336;
    color: #f44336;
}

.toast.info {
    border-color: #2196f3;
    color: #2196f3;
}

/* ==================== MODAL ==================== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

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

.modal-content {
    width: 100%;
    max-width: 480px;
    background: #0a0a0a;
    border: 1px solid #333;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-content.closing {
    transform: translateY(100%);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    background: #0a0a0a;
}

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

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
}

/* Top Up Modal */
.amount-presets {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.amount-preset {
    flex: 1;
    padding: 12px;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.amount-preset:hover,
.amount-preset.selected {
    background: #fff;
    color: #000;
}

.amount-custom {
    margin-bottom: 16px;
}

.amount-custom label {
    display: block;
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}

.amount-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.amount-input-wrapper input {
    width: 100%;
    padding: 14px 40px 14px 16px;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    font-size: 16px;
    outline: none;
}

.amount-input-wrapper input:focus {
    border-color: #fff;
}

.currency-symbol {
    position: absolute;
    right: 16px;
    color: #888;
    font-size: 16px;
}

.payment-info {
    padding: 12px;
    background: #1a1a1a;
    border: 1px solid #333;
    margin-bottom: 16px;
}

.payment-info p {
    font-size: 13px;
    margin-bottom: 4px;
}

.payment-info p:last-child {
    margin-bottom: 0;
}

.payment-note {
    color: #888 !important;
    font-size: 12px !important;
}

.btn-pay {
    width: 100%;
    padding: 14px 24px;
    background: #fff;
    color: #000;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-pay svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.btn-pay:active {
    background: #ccc;
}

/* Subscription Modal */
.subscription-plans {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.plan-card {
    border: 1px solid #333;
    padding: 16px;
    position: relative;
}

.plan-card.featured {
    border-color: #fff;
}

.plan-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    background: #fff;
    color: #000;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
}

.plan-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.plan-icon {
    font-size: 24px;
}

.plan-header h4 {
    font-size: 16px;
    font-weight: 600;
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 12px;
}

.plan-price .price-value {
    font-size: 28px;
    font-weight: 700;
}

.plan-price .price-period {
    font-size: 14px;
    color: #888;
}

.plan-features {
    list-style: none;
    margin-bottom: 16px;
}

.plan-features li {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 6px;
}

.plan-features li:last-child {
    margin-bottom: 0;
}

.btn-plan-select {
    width: 100%;
    padding: 12px 24px;
    background: #fff;
    color: #000;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-plan-select:active {
    background: #ccc;
}

.btn-plan-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.balance-info {
    padding: 12px;
    background: #1a1a1a;
    border: 1px solid #333;
}

.balance-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 4px;
}

.balance-title svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.balance-note {
    font-size: 12px;
    color: #888;
}

/* Instruction Modal */
.instruction-step {
    margin-bottom: 20px;
}

.instruction-step:last-child {
    margin-bottom: 0;
}

.instruction-step h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
}

.instruction-step p {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 10px;
}

.instruction-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.instruction-link {
    padding: 12px 16px;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.instruction-link:active {
    background: #2a2a2a;
}

.instruction-list {
    list-style: none;
}

.instruction-list li {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 8px;
    line-height: 1.5;
}

.instruction-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #333;
    text-align: center;
}

.instruction-footer p {
    font-size: 14px;
    color: #888;
    margin-bottom: 12px;
}

.btn-done {
    padding: 12px 32px;
    background: #fff;
    color: #000;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-done:active {
    background: #ccc;
}

/* Body when modal is open */
body.modal-open {
    overflow: hidden;
}
