/* ================================================================
   Fallah Gold - Online Gold & Invoice Calculator Styles (Single Column UI)
   ================================================================ */

.calc-page-wrapper {
    min-height: 100vh;
    padding-bottom: 50px;
}

/* Hero Section */
.calc-hero-section {
    padding: 16px 12px 10px;
    background: radial-gradient(circle at 50% 0%, rgba(202, 163, 98, 0.08) 0%, transparent 70%);
}

.calc-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--gold-light, #e6be75);
    background: rgba(202, 163, 98, 0.12);
    border: 1px solid rgba(202, 163, 98, 0.3);
    padding: 4px 14px;
    border-radius: 50px;
    margin-bottom: 10px;
}

.calc-hero-title {
    font-size: 1.55rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary, #ffffff);
    letter-spacing: -0.3px;
}

.calc-hero-subtitle {
    font-size: 0.86rem;
    color: var(--text-secondary, #b8b3a8);
    max-width: 620px;
    margin: 0 auto 16px;
    line-height: 1.6;
}

/* Live Gold Ticker Banner */
.calc-ticker-card {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95), rgba(35, 35, 35, 0.9));
    border: 1px solid rgba(202, 163, 98, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 15px rgba(202, 163, 98, 0.06);
    border-radius: 14px;
    padding: 10px 18px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.calc-ticker-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.calc-ticker-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(202, 163, 98, 0.15);
    border: 1px solid rgba(202, 163, 98, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-light, #e6be75);
    font-size: 1.1rem;
}

.calc-ticker-label {
    font-size: 0.74rem;
    color: var(--text-secondary, #b8b3a8);
    display: block;
    margin-bottom: 1px;
}

.calc-ticker-val {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
}

.calc-ticker-val small {
    font-size: 0.76rem;
    font-weight: normal;
    color: var(--text-secondary, #b8b3a8);
    margin-right: 4px;
}

/* Tabs Navigation */
.calc-nav-tabs {
    border-bottom: none;
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.calc-nav-tab-btn {
    background: rgba(26, 26, 26, 0.85);
    border: 1px solid rgba(202, 163, 98, 0.2);
    color: var(--text-secondary, #b8b3a8);
    padding: 8px 18px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.86rem;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.calc-nav-tab-btn i {
    font-size: 0.95rem;
}

.calc-nav-tab-btn:hover {
    color: var(--gold-light, #e6be75);
    border-color: rgba(202, 163, 98, 0.45);
    background: rgba(35, 35, 35, 0.95);
}

.calc-nav-tab-btn.active {
    background: linear-gradient(135deg, #caa362, #e6be75);
    color: #111111;
    border-color: #e6be75;
    box-shadow: 0 4px 14px rgba(202, 163, 98, 0.3);
    font-weight: 700;
}

.calc-nav-tab-btn.active i {
    color: #111111;
}

/* Main Calculator Form Card (Top Box) */
.calc-box-card {
    background: var(--bg-card, #1A1A1A);
    border: 1px solid rgba(202, 163, 98, 0.2);
    border-radius: 16px;
    padding: 22px 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    margin-bottom: 20px;
    width: 100%;
}

.calc-box-header {
    border-bottom: 1px solid rgba(202, 163, 98, 0.12);
    padding-bottom: 10px;
    margin-bottom: 16px;
}

.calc-box-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.calc-box-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary, #b8b3a8);
    margin-bottom: 0;
}

/* Form Controls */
.calc-field-group {
    margin-bottom: 16px;
}

.calc-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary, #f8f5ef);
    margin-bottom: 6px;
}

.calc-label-tip {
    font-size: 0.74rem;
    color: var(--gold-light, #e6be75);
    font-weight: normal;
}

.calc-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.calc-input {
    width: 100%;
    background: rgba(17, 17, 17, 0.8);
    border: 1px solid rgba(202, 163, 98, 0.26);
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 14px;
    padding-left: 55px; /* RTL left suffix */
    transition: all 0.2s ease;
    text-align: right;
    direction: ltr;
}

.calc-input:focus {
    outline: none;
    border-color: var(--gold-light, #e6be75);
    box-shadow: 0 0 0 3px rgba(202, 163, 98, 0.18);
    background: rgba(22, 22, 22, 0.95);
}

.calc-input-unit {
    position: absolute;
    left: 12px;
    font-size: 0.78rem;
    color: var(--text-secondary, #b8b3a8);
    pointer-events: none;
    font-weight: 500;
}

/* Action Button */
.calc-action-btn {
    width: 100%;
    background: linear-gradient(135deg, #caa362, #e6be75);
    color: #111111;
    font-weight: 700;
    font-size: 0.98rem;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    margin-top: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 18px rgba(202, 163, 98, 0.28);
}

.calc-action-btn:hover {
    background: linear-gradient(135deg, #d6b77e, #f1cb88);
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(202, 163, 98, 0.42);
}

.calc-action-btn:active {
    transform: translateY(0);
}

/* Preset Chips */
.calc-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

.calc-chip-btn {
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(202, 163, 98, 0.16);
    color: var(--text-secondary, #b8b3a8);
    font-size: 0.74rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calc-chip-btn:hover,
.calc-chip-btn.active {
    background: rgba(202, 163, 98, 0.18);
    border-color: var(--gold-primary, #caa362);
    color: var(--gold-light, #e6be75);
}

/* Range Slider */
.calc-range-wrap {
    margin-top: 8px;
}

.calc-range-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 5px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 5px;
    outline: none;
    transition: background 0.2s;
}

.calc-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gold-light, #e6be75);
    cursor: pointer;
    box-shadow: 0 0 6px rgba(202, 163, 98, 0.5);
}

.calc-range-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gold-light, #e6be75);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 6px rgba(202, 163, 98, 0.5);
}

/* Invoice Result Card (Bottom Box) */
.calc-result-card {
    background: linear-gradient(145deg, rgba(28, 28, 28, 0.95), rgba(20, 20, 20, 0.98));
    border: 1px solid rgba(202, 163, 98, 0.3);
    border-radius: 16px;
    padding: 22px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 18px rgba(202, 163, 98, 0.06);
    margin-bottom: 20px;
    width: 100%;
}

.calc-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px dashed rgba(202, 163, 98, 0.2);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.calc-result-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.calc-official-badge {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 50px;
}

/* Grand Total Showcase */
.calc-grand-total-box {
    background: linear-gradient(135deg, rgba(202, 163, 98, 0.12), rgba(202, 163, 98, 0.03));
    border: 1px solid rgba(202, 163, 98, 0.35);
    border-radius: 14px;
    padding: 14px 16px;
    text-align: center;
    margin-bottom: 16px;
}

.calc-grand-label {
    font-size: 0.78rem;
    color: var(--gold-light, #e6be75);
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.calc-grand-amount {
    font-size: 1.7rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.calc-grand-amount small {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gold-primary, #caa362);
    margin-right: 5px;
}

.calc-per-gram-line {
    font-size: 0.76rem;
    color: var(--text-secondary, #b8b3a8);
    margin-top: 4px;
}

/* Distribution Bar */
.calc-dist-bar-wrapper {
    margin-bottom: 16px;
}

.calc-dist-bar {
    height: 7px;
    border-radius: 4px;
    background: #252525;
    display: flex;
    overflow: hidden;
    margin-bottom: 6px;
}

.calc-bar-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.calc-bar-gold { background: #caa362; }
.calc-bar-wage { background: #60a5fa; }
.calc-bar-profit { background: #34d399; }
.calc-bar-tax { background: #f87171; }

.calc-dist-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-secondary, #b8b3a8);
}

.calc-legend-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-left: 3px;
}

/* Line Item Rows */
.calc-line-items {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
}

.calc-line-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
}

.calc-line-item:last-child {
    border-bottom: none;
}

.calc-item-name {
    color: var(--text-secondary, #b8b3a8);
    display: flex;
    align-items: center;
    gap: 6px;
}

.calc-item-name i {
    font-size: 0.9rem;
}

.calc-item-val {
    font-weight: 700;
    color: var(--text-primary, #ffffff);
}

.calc-item-val small {
    font-size: 0.72rem;
    font-weight: normal;
    color: var(--text-secondary, #b8b3a8);
    margin-right: 4px;
}

/* Analysis verdict badge */
.calc-verdict-box {
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.8rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.calc-verdict-fair {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.calc-verdict-fair i {
    color: #22c55e;
    font-size: 1.1rem;
}

.calc-verdict-warn {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    color: #fde047;
}

.calc-verdict-warn i {
    color: #eab308;
    font-size: 1.1rem;
}

.calc-verdict-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.calc-verdict-danger i {
    color: #ef4444;
    font-size: 1.1rem;
}

/* ================================================================
   LIGHT THEME OVERRIDES (html[data-theme="light"])
   ================================================================ */
html[data-theme="light"] .calc-page-wrapper {
    background: #fdfbf7;
}

html[data-theme="light"] .calc-hero-section {
    background: radial-gradient(circle at 50% 0%, rgba(181, 138, 56, 0.08) 0%, transparent 70%);
}

html[data-theme="light"] .calc-hero-eyebrow {
    color: #8c6519;
    background: rgba(181, 138, 56, 0.12);
    border-color: rgba(181, 138, 56, 0.3);
}

html[data-theme="light"] .calc-hero-title,
html[data-theme="light"] .calc-box-title,
html[data-theme="light"] .calc-result-title {
    color: #222222;
}

html[data-theme="light"] .calc-hero-subtitle,
html[data-theme="light"] .calc-box-subtitle,
html[data-theme="light"] .calc-item-name,
html[data-theme="light"] .calc-ticker-label {
    color: #666666;
}

html[data-theme="light"] .calc-ticker-card {
    background: #ffffff;
    border-color: rgba(181, 138, 56, 0.35);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .calc-ticker-val,
html[data-theme="light"] .calc-item-val {
    color: #222222;
}

html[data-theme="light"] .calc-nav-tab-btn {
    background: #ffffff;
    border-color: rgba(181, 138, 56, 0.25);
    color: #555555;
}

html[data-theme="light"] .calc-nav-tab-btn:hover {
    color: #8c6519;
    background: #fdf9f0;
}

html[data-theme="light"] .calc-nav-tab-btn.active {
    background: linear-gradient(135deg, #b58a38, #d4a955);
    color: #ffffff;
    border-color: #b58a38;
}

html[data-theme="light"] .calc-nav-tab-btn.active i {
    color: #ffffff;
}

html[data-theme="light"] .calc-box-card {
    background: #ffffff;
    border-color: rgba(181, 138, 56, 0.25);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .calc-input {
    background: #faf8f5;
    border-color: rgba(181, 138, 56, 0.35);
    color: #222222;
}

html[data-theme="light"] .calc-input:focus {
    background: #ffffff;
    border-color: #b58a38;
}

html[data-theme="light"] .calc-action-btn {
    background: linear-gradient(135deg, #b58a38, #d4a955);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(181, 138, 56, 0.25);
}

html[data-theme="light"] .calc-action-btn:hover {
    background: linear-gradient(135deg, #c49944, #e2b763);
}

html[data-theme="light"] .calc-chip-btn {
    background: #f5f2eb;
    border-color: rgba(181, 138, 56, 0.2);
    color: #666666;
}

html[data-theme="light"] .calc-chip-btn:hover,
html[data-theme="light"] .calc-chip-btn.active {
    background: rgba(181, 138, 56, 0.15);
    border-color: #b58a38;
    color: #8c6519;
}

html[data-theme="light"] .calc-result-card {
    background: #ffffff;
    border-color: rgba(181, 138, 56, 0.35);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .calc-grand-total-box {
    background: linear-gradient(135deg, rgba(181, 138, 56, 0.1), rgba(181, 138, 56, 0.02));
    border-color: rgba(181, 138, 56, 0.4);
}

html[data-theme="light"] .calc-grand-amount {
    color: #222222;
}

html[data-theme="light"] .calc-grand-amount small {
    color: #8c6519;
}

html[data-theme="light"] .calc-line-item {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .calc-dist-bar {
    background: #ebe6dd;
}

html[data-theme="light"] .calc-verdict-fair {
    background: rgba(34, 197, 94, 0.08);
    color: #15803d;
}

html[data-theme="light"] .calc-verdict-warn {
    background: rgba(234, 179, 8, 0.08);
    color: #a16207;
}

html[data-theme="light"] .calc-verdict-danger {
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c;
}
