/* El-Duck VPN - New Design */

* {
    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;
    overflow-y: scroll;
}

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

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    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: transparent;
    border-top: 1px solid #333;
    z-index: 100;
}

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

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

.nav-item .nav-icon,
.nav-item svg {
    width: 24px;
    height: 24px;
    filter: invert(1);
    transition: filter 0.2s;
}

.nav-item.active .nav-icon,
.nav-item.active svg {
    filter: invert(0);
}

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

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

/* Main Content */
.main {
    flex: 1;
    padding: 20px 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;
}

/* Section Title */
.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

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

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

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.profile-name {
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 3px 0;
}

.profile-username {
    font-size: 12px;
    color: #666;
    margin: 0;
}

/* Balance Card */
.balance-card {
    backdrop-filter: blur(10px);
    border: 1px solid #333;
    padding: 18px;
    margin-bottom: 14px;
}

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

.balance-label {
    font-size: 12px;
    color: #666;
}

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

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

.refresh-icon {
    width: 17px;
    height: 17px;
    filter: invert(1);
}

.balance-amount {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 14px;
}

#balanceValue {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
}

.balance-currency {
    font-size: 15px;
    color: #666;
}

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

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

.btn-topup svg {
    stroke: #000;
    width: 19px;
    height: 19px;
}

/* Subscription Card */
.subscription-card {
    backdrop-filter: blur(10px);
    border: 1px solid #333;
    padding: 18px;
    margin-bottom: 14px;
}

.subscription-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 12px 0;
}

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

.subscription-status.active {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.status-icon {
    font-size: 17px;
}

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

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

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

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

/* Profile Stats */
.profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

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

.stat-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

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

/* VPN Section with Background */
#vpn-section {
    position: relative;
    background: url('ascii-duck-2.gif') no-repeat center 90%;
    background-size: 300px;
    min-height: calc(100vh - 180px);
}

/* Cards Grid */
.cards-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card {
    backdrop-filter: blur(10px);
    border: 1px solid #333;
    padding: 20px;
}

.card-header {
    margin-bottom: 12px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.new-badge {
    background: #fff;
    color: #000;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    text-transform: uppercase;
}

.card p {
    font-size: 13px;
    color: #ccc;
    line-height: 1.6;
    margin: 0 0 20px 0;
}

.card-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    width: 100%;
    padding: 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: #fff;
    color: #000;
    border: none;
}

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

.btn-secondary {
    background: transparent;
    border: 1px solid #333;
    color: #fff;
}

.btn-secondary:active {
    background: #333;
    border-color: #333;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1a1a1a;
    color: #fff;
    padding: 12px 20px;
    border-radius: 0;
    z-index: 2000;
    transition: transform 0.3s;
    width: max-content;
    max-width: 80%;
    text-align: center;
    font-size: 13px;
}

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

.toast.success {
    background: #22c55e;
}

.toast.error {
    background: #ef4444;
}

.toast.info {
    background: #3b82f6;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: flex-end;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 0;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

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

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

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

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 20px;
}

/* Amount Presets */
.amount-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.amount-preset {
    backdrop-filter: blur(10px);
    border: 1px solid #333;
    color: #fff;
    padding: 14px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Amount Custom */
.amount-custom {
    margin-bottom: 20px;
}

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

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

.amount-input-wrapper input {
    flex: 1;
    backdrop-filter: blur(10px);
    border: 1px solid #333;
    color: #fff;
    padding: 14px 40px 14px 14px;
    font-size: 16px;
    font-weight: 500;
}

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

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

/* Payment Info */
.payment-info {
    backdrop-filter: blur(10px);
    border: 1px solid #333;
    padding: 14px;
    margin-bottom: 20px;
}

.payment-info p {
    font-size: 13px;
    color: #fff;
    margin: 0;
}

.payment-note {
    color: #666 !important;
    margin-top: 4px !important;
}

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

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

.btn-pay svg {
    stroke: #000;
}

/* Subscription Plans */
.subscription-plans {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

.plan-card {
    backdrop-filter: blur(10px);
    border: 1px solid #333;
    padding: 20px;
    position: relative;
}

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

.plan-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #000;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

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

.plan-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.plan-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 16px;
}

.price-value {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.price-period {
    font-size: 13px;
    color: #666;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.plan-features li {
    font-size: 13px;
    color: #ccc;
    padding: 6px 0;
    border-bottom: 1px solid #333;
}

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

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

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

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

/* Balance Info */
.balance-info {
    backdrop-filter: blur(10px);
    border: 1px solid #333;
    padding: 16px;
    margin-bottom: 16px;
}

.balance-title {
    font-size: 14px;
    color: #fff;
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.balance-title .balance-icon {
    width: 20px;
    height: 20px;
    filter: invert(1);
}

#currentBalance {
    font-weight: 700;
}

.balance-note {
    font-size: 12px;
    color: #666;
    margin: 0;
}

/* Modal Overlay */
.modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    z-index: 1;
}

/* Modal Open State */
body.modal-open {
    overflow: hidden;
}

.modal-content.closing {
    animation: modalClose 0.3s ease-out;
}

@keyframes modalClose {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(20px);
        opacity: 0;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #333;
}

::-webkit-scrollbar-thumb:hover {
    background: #666;
}
