/* ─── DRABA VENTURES CALCULATOR - PREMIUM DARK THEME ─── */

:root {
    --navy:        #0D1B2A;
    --navy-mid:    #1A2F45;
    --navy-light:  #243B55;
    --gold:        #B8963E;
    --gold-light:  #D4AF65;
    --gold-pale:   rgba(184,150,62,0.15);
    --white:       #FFFFFF;
    --text-bright: rgba(255,255,255,0.92);
    --text-mid:    rgba(255,255,255,0.58);
    --text-dim:    rgba(255,255,255,0.35);
    --border:      rgba(184,150,62,0.18);
    --border-soft: rgba(255,255,255,0.08);
    --radius:      4px;
    --radius-md:   8px;
    --radius-lg:   12px;
    --transition:  0.22s ease;
    --shadow-card: 0 4px 32px rgba(0,0,0,0.35);

    /* Legacy aliases - keep JS working */
    --primary-navy: #0D1B2A;
    --primary-gold: #B8963E;
    --text-dark:    rgba(255,255,255,0.92);
    --text-light:   rgba(255,255,255,0.5);
    --bg-light:     rgba(255,255,255,0.06);
    --success:      #10b981;
    --warning:      #F59E0B;
    --error:        #EF4444;
    --glass-bg:     rgba(26,47,69,0.85);
    --glass-border: rgba(184,150,62,0.2);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.3);
    --radius-sm:    4px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── BODY ── when used standalone (calculator/calculator.html) */
body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(160deg, #07111c 0%, #0d1b2a 60%, #07111c 100%);
    color: var(--text-bright);
    min-height: 100vh;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-x: hidden;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 {
    font-family: 'Cormorant Garamond', serif;
    color: var(--text-bright);
}

/* ── GLASS CARD ── */
.glass-card {
    background: rgba(26, 47, 69, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

/* ── CALCULATOR CONTAINER ── */
.calculator-container {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── HEADER ── */
.calc-header {
    text-align: center;
    padding: 2rem 1.5rem 1.25rem;
    background: linear-gradient(135deg, rgba(26,47,69,0.9) 0%, rgba(13,27,42,0.95) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.company-name {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gold-light);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-bottom: 0.75rem;
    display: block;
}

.calc-header h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 600;
    color: var(--white);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.calc-header p {
    color: var(--text-mid);
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

/* ── LIVE STATUS BADGE ── */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.25);
    padding: 5px 14px;
    border-radius: 30px;
    margin: 0 auto 1rem auto;
    transition: all 0.3s ease;
}

.live-badge.hidden { display: none !important; }

#price-source-text {
    color: #6ee7b7;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.green-dot {
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.green-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 1.5px solid #10b981;
    border-radius: 50%;
    opacity: 0;
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
    0%   { transform: scale(0.8); opacity: 0; }
    50%  { opacity: 0.5; }
    100% { transform: scale(2.4); opacity: 0; }
}

/* ── MAIN GRID ── */
.calc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .calc-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ── PANELS ── */
.calc-panel {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
}

/* ── INPUT GROUPS ── */
.input-group {
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-mid);
    margin-bottom: 0.55rem;
}

.input-group select,
.input-group input[type="number"],
.input-group input[type="email"] {
    width: 100%;
    height: 46px;
    padding: 0 1rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-bright);
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

/* Custom arrow for selects */
.input-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23B8963E' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 2.5rem;
}

.input-group select option {
    background: #1A2F45;
    color: #fff;
}

.input-group select:focus,
.input-group input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184,150,62,0.15);
}

.meta-info {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 0.45rem;
    display: flex;
    gap: 0.5rem;
}

/* ── QUANTITY CONTROLS ── */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-icon {
    width: 46px;
    height: 46px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    font-size: 1.3rem;
    color: var(--text-bright);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), border-color var(--transition);
    flex-shrink: 0;
}

.btn-icon:hover {
    background: rgba(184,150,62,0.12);
    border-color: var(--gold);
}

.quantity-controls input[type="number"] {
    width: 90px;
    height: 46px;
    padding: 0;
    text-align: center;
    flex-shrink: 0;
}

.unit-toggle {
    display: flex;
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    overflow: hidden;
}

.unit-toggle input[type="radio"] { display: none; }

.unit-toggle label {
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    cursor: pointer;
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-mid);
    transition: all var(--transition);
    white-space: nowrap;
}

.unit-toggle input[type="radio"]:checked + label {
    background: var(--gold);
    color: #fff;
}

/* ── RESULTS HEADER ── */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-soft);
}

.results-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-bright);
}

.currency-selector select {
    height: 32px;
    padding: 0 0.75rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    color: var(--text-bright);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.currency-selector select option {
    background: #1A2F45;
}

/* ── RESULT ROWS ── */
.results-table {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    font-size: 0.9rem;
    color: var(--text-mid);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.result-row:last-child { border-bottom: none; }

.result-row.line-under {
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 0.85rem;
    margin-bottom: 0.5rem;
}

.result-row.subtotal {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
    padding-top: 0.75rem;
}

.result-row.total {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-bright);
    padding-top: 0.75rem;
}

.result-row.sm {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.value {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-bright);
}

.value.highlight {
    color: var(--gold-light);
    font-size: 1.2rem;
}

.blur-text {
    filter: blur(5px);
    user-select: none;
}

.lock-icon {
    margin-right: 0.35rem;
    opacity: 0.5;
    flex-shrink: 0;
}

.locked { opacity: 0.85; }
.locked.unlocked { opacity: 1; }
.locked.unlocked .blur-text { filter: none; }
.locked.unlocked .lock-icon { display: none; }

/* ── ALERTS ── */
#alerts-container { margin-bottom: 1rem; }

.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.6rem;
    font-size: 0.86rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert-warning {
    background: rgba(245,158,11,0.12);
    border-left: 3px solid var(--warning);
    color: #fcd34d;
}

.alert-tip {
    background: rgba(16,185,129,0.1);
    border-left: 3px solid var(--success);
    color: #6ee7b7;
}

.alert-error {
    background: rgba(239,68,68,0.1);
    border-left: 3px solid var(--error);
    color: #fca5a5;
}

/* ── BUTTONS ── */
.btn-primary,
.btn-secondary,
.btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 48px;
    padding: 0 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, #a37835 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(184,150,62,0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(184,150,62,0.4);
}

.btn-secondary {
    background: rgba(255,255,255,0.07);
    color: var(--text-bright);
    border: 1px solid var(--border-soft);
}

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

.btn-success {
    background: #25D366;
    color: #fff;
    flex: 1;
    box-shadow: 0 4px 16px rgba(37,211,102,0.25);
}

.btn-success:hover {
    background: #20BA56;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37,211,102,0.35);
}

.full-width { width: 100%; }

.action-section { margin-top: 1.5rem; }

#unlocked-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* ── CALC FOOTER ── */
.calc-footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    border-top: 1px solid var(--border-soft);
    margin-top: 0.5rem;
}

.calc-footer a {
    color: var(--gold-light);
    text-decoration: none;
    font-weight: 600;
}

.calc-footer a:hover { color: var(--gold); }

/* ── MODAL ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5,12,20,0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 2rem;
    background: #1A2F45;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
    color: var(--text-bright);
}

.modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.modal-content > p {
    color: var(--text-mid);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.benefit-list {
    list-style: none;
    margin-bottom: 1.5rem;
}

.benefit-list li {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6ee7b7;
}

.btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.08);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

.btn-close:hover { background: rgba(255,255,255,0.15); color: #fff; }

#email-unlock-form input[type="email"] {
    width: 100%;
    height: 46px;
    padding: 0 1rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: var(--text-bright);
    font-family: 'Inter', sans-serif;
}

#email-unlock-form input::placeholder { color: var(--text-dim); }

#email-unlock-form input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184,150,62,0.15);
}

#email-unlock-form button { width: 100%; }

.privacy {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* ── UTILITY ── */
.hidden { display: none !important; }
.blur   { filter: blur(4px); }

/* ── RESPONSIVE ── */
@media (max-width: 767px) {
    body { padding: 1rem 0.75rem; }
    .calc-panel { padding: 1.25rem; }
    .calc-header { padding: 1.5rem 1.25rem 1rem; }
    .calc-header h2 { font-size: 1.5rem; }
    .results-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}
