:root {
    --bg-dark: #070913;
    --card-bg: rgba(18, 24, 40, 0.75);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary-cyan: #00F2FE;
    --primary-blue: #4FACFE;
    --accent-green: #10B981;
    --accent-red: #EF4444;
    --text-main: #F3F4F6;
    --text-muted: #9CA3AF;
    --gradient-brand: linear-gradient(135deg, #00F2FE 0%, #4FACFE 100%);
    --gradient-btn: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
    --gradient-mp: linear-gradient(135deg, #009EE3 0%, #0072BB 100%);
    --radius-lg: 16px;
    --radius-md: 10px;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

.background-glow {
    position: absolute;
    top: -20%;
    left: 20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.12) 0%, rgba(79, 172, 254, 0.05) 50%, transparent 70%);
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    padding: 24px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Header */
.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
}

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

.brand-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 400;
}

.brand-title b {
    font-weight: 700;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
    100% { opacity: 1; transform: scale(1); }
}

.balance-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.balance-card:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(0, 242, 254, 0.4);
}

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

.balance-value {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--primary-cyan);
    font-size: 0.95rem;
}

.btn-add-funds {
    background: var(--gradient-brand);
    border: none;
    color: #000;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-header h2, .card-header h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    margin-bottom: 4px;
}

.card-header p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* Form inputs */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.phone-input-group {
    display: flex;
    gap: 8px;
}

.country-select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 12px;
    border-radius: var(--radius-md);
    outline: none;
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
}

.phone-input, .custom-select {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    outline: none;
    font-size: 1.05rem;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
    transition: border-color 0.2s;
}

.phone-input:focus, .custom-select:focus, .country-select:focus {
    border-color: var(--primary-cyan);
}

/* Dialpad Grid */
.dialpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 320px;
    margin: 8px auto;
}

.dial-key {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    border-radius: 12px;
    padding: 12px;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.dial-key span {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 400;
}

.dial-key:hover {
    background: rgba(0, 242, 254, 0.12);
    border-color: rgba(0, 242, 254, 0.4);
}

.dial-key:active {
    transform: scale(0.95);
}

.delete-key {
    color: var(--accent-red);
}

/* Buttons */
.btn-call {
    width: 100%;
    background: var(--gradient-btn);
    border: none;
    color: #FFF;
    padding: 14px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
    transition: all 0.2s ease;
}

.btn-call:hover {
    box-shadow: 0 6px 25px rgba(0, 242, 254, 0.5);
    transform: translateY(-1px);
}

/* HIGH SPECIFICITY RED BUTTON WHEN CALL IS ACTIVE */
#callBtn.active-call {
    background: linear-gradient(135deg, #DC2626 0%, #EF4444 100%) !important;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

#callBtn.active-call:hover {
    box-shadow: 0 6px 25px rgba(239, 68, 68, 0.8) !important;
    transform: translateY(-1px);
}

.btn-logout {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* Console Card */
.right-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.console-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
}

.badge.active {
    background: rgba(0, 242, 254, 0.15);
    color: var(--primary-cyan);
}

.console-body {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px;
    min-height: 120px;
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: monospace;
    font-size: 0.85rem;
}

.log-entry.info { color: #9CA3AF; }
.log-entry.success { color: var(--accent-green); }
.log-entry.error { color: var(--accent-red); }

/* Recharge Card */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.pkg-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.pkg-card:hover, .pkg-card.active {
    background: rgba(0, 158, 227, 0.12);
    border-color: #009EE3;
}

.pkg-badge {
    position: absolute;
    top: -8px;
    background: #009EE3;
    color: #FFF;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
}

.pkg-mins {
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 4px;
}

.pkg-price {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-mercadopago {
    width: 100%;
    background: var(--gradient-mp);
    border: none;
    color: #FFF;
    padding: 14px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 158, 227, 0.3);
    transition: all 0.2s ease;
}

.btn-mercadopago:hover {
    box-shadow: 0 6px 20px rgba(0, 158, 227, 0.5);
}

.btn-hangup {
    width: 100%;
    background: linear-gradient(135deg, #DC2626 0%, #EF4444 100%);
    border: none;
    color: #FFF;
    padding: 14px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
    transition: all 0.2s ease;
}

.btn-hangup:hover {
    box-shadow: 0 6px 25px rgba(239, 68, 68, 0.6);
    transform: translateY(-1px);
}

/* Modal for Balance Recharge */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    max-width: 520px;
    width: 100%;
    background: rgba(18, 24, 40, 0.95);
    border: 1px solid rgba(0, 242, 254, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 242, 254, 0.2);
    position: relative;
    border-radius: var(--radius-lg);
}

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

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.2s;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 12px 0;
}

/* Language Toggle Button */
.btn-lang {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(0, 242, 254, 0.3);
    color: var(--text-main);
    padding: 7px 14px;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-lang:hover {
    background: rgba(0, 242, 254, 0.15);
    border-color: var(--primary-cyan);
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);
    transform: translateY(-1px);
}

/* WhatsApp Floating Support Button */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #25D366;
    color: #FFFFFF;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(37, 211, 102, 0.45);
    z-index: 9999;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.whatsapp-float:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.65);
    color: #FFFFFF;
}

.whatsapp-tooltip {
    position: absolute;
    right: 68px;
    background: rgba(18, 24, 40, 0.95);
    border: 1px solid rgba(37, 211, 102, 0.4);
    color: #FFFFFF;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
}

.rate-indicator {
    font-size: 0.82rem;
    color: #94A3B8;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
