/* Gold & Silver Calculator Styles - Professional & Clean */
.gold-calculator-wrapper,
.silver-calculator-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    max-width: 900px;
    margin: 30px auto;
    padding: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    direction: rtl;
}

/* Update Header with Countdown */
.calculator-update-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f8f8;
    border-bottom: 1px solid #e0e0e0;
}

.update-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.update-label {
    font-size: 11px;
    color: #666666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.update-time {
    font-size: 14px;
    color: #000000;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.countdown-wrapper {
    position: relative;
    width: 50px;
    height: 50px;
}

.countdown-circle {
    transform: rotate(-90deg);
}

.countdown-bg {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 3;
}

.countdown-progress {
    fill: none;
    stroke: #000000;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.countdown-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 700;
    color: #000000;
    font-family: 'Courier New', monospace;
}


.gold-price-table,
.silver-price-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
    background: #fff;
}

.gold-price-table thead,
.silver-price-table thead {
    background: #000000;
    color: #ffffff;
}

.gold-price-table thead th,
.silver-price-table thead th {
    padding: 16px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    border-right: 1px solid #333333;
    letter-spacing: 0.3px;
}

.gold-price-table thead th:first-child,
.silver-price-table thead th:first-child {
    border-right: none;
}

.gold-price-table thead th .small-text,
.silver-price-table thead th .small-text {
    display: block;
    font-size: 11px;
    font-weight: 400;
    margin-top: 4px;
    opacity: 0.85;
}

.gold-price-table tbody tr,
.silver-price-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.15s ease;
}

.gold-price-table tbody tr:hover,
.silver-price-table tbody tr:hover {
    background-color: #f5f5f5;
}

.gold-price-table tbody tr:last-child,
.silver-price-table tbody tr:last-child {
    border-bottom: none;
}

.gold-price-table tbody td,
.silver-price-table tbody td {
    padding: 16px 12px;
    text-align: center;
    font-size: 15px;
    color: #000000;
}

/* Gold Badge */
.gold-badge .badge {
    display: inline-block;
    background: linear-gradient(135deg, #C9A961 0%, #D4AF37 50%, #C9A961 100%);
    color: #ffffff;
    padding: 6px 14px;
    border: 1px solid #B8960C;
    font-weight: 600;
    font-size: 15px;
    min-width: 50px;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Silver Badge */
.silver-badge .badge {
    display: inline-block;
    background: linear-gradient(135deg, #B8B8B8 0%, #D3D3D3 50%, #B8B8B8 100%);
    color: #000000;
    padding: 6px 14px;
    border: 1px solid #999999;
    font-weight: 600;
    font-size: 15px;
    min-width: 50px;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

.price-sell,
.price-buy {
    font-weight: 600;
    color: #000000;
    font-size: 15px;
}

.price-buy {
    color: #333333;
}

.weight-input {
    padding: 8px;
}

.weight-field {
    width: 100%;
    max-width: 120px;
    padding: 10px 12px;
    border: 1px solid #cccccc;
    font-size: 15px;
    text-align: center;
    transition: border-color 0.2s ease;
    direction: ltr;
    background: #ffffff;
}

.weight-field:focus {
    outline: none;
    border-color: #000000;
}

.weight-field:hover {
    border-color: #999999;
}

.total-price {
    font-weight: 700;
    color: #000000;
    font-size: 16px;
}

.total-amount {
    display: inline-block;
    min-width: 80px;
}

.gold-calculator-info,
.silver-calculator-info {
    text-align: center;
    padding: 16px;
    background: #f5f5f5;
    margin-top: 0;
    border-top: 1px solid #e0e0e0;
}

.gold-calculator-info p,
.silver-calculator-info p {
    margin: 0;
    color: #666666;
    font-size: 13px;
}

.gold-calculator-info strong,
.silver-calculator-info strong {
    color: #000000;
    font-size: 15px;
    font-weight: 600;
}

.gold-update-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #000000;
    color: #ffffff;
    padding: 12px 20px;
    border: 1px solid #000000;
    z-index: 9999;
    font-weight: 500;
    font-size: 14px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .gold-calculator-wrapper,
    .silver-calculator-wrapper {
        padding: 0;
        margin: 15px;
    }

    .calculator-update-header {
        padding: 12px 15px;
    }

    .update-label {
        font-size: 10px;
    }

    .update-time {
        font-size: 12px;
    }

    .countdown-wrapper {
        width: 40px;
        height: 40px;
    }

    .countdown-circle {
        width: 40px;
        height: 40px;
    }

    .countdown-bg,
    .countdown-progress {
        cx: 20;
        cy: 20;
        r: 16;
    }

    .countdown-text {
        font-size: 12px;
    }

    .gold-price-table,
    .silver-price-table {
        font-size: 12px;
    }

    .gold-price-table thead th,
    .gold-price-table tbody td,
    .silver-price-table thead th,
    .silver-price-table tbody td {
        padding: 12px 8px;
        font-size: 12px;
    }

    .gold-badge .badge,
    .silver-badge .badge {
        padding: 5px 10px;
        font-size: 13px;
    }

    .weight-field {
        max-width: 80px;
        padding: 8px;
        font-size: 13px;
    }

    .price-sell,
    .price-buy,
    .total-price {
        font-size: 13px;
    }
}

@media screen and (max-width: 480px) {
    .gold-price-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .gold-calculator-header h2 {
        font-size: 18px;
    }
}

/* ===== Slider Quick Calculator ===== */
.slider-calculator {
    padding: 20px 20px 24px;
    background: #ffffff;
}

.slider-header-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.slider-title {
    font-size: 14px;
    font-weight: 600;
    color: #000000;
    margin-left: auto;
}

.slider-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.grams-field {
    width: 56px;
    padding: 6px 4px;
    border: 1px solid #cccccc;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    direction: ltr;
    background: #ffffff;
    transition: border-color 0.2s ease;
    -moz-appearance: textfield;
}

.karat-field {
    width: 64px;
    padding: 6px 6px;
    border: 1px solid #cccccc;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    direction: ltr;
    background: #ffffff;
    transition: border-color 0.2s ease;
    -moz-appearance: textfield;
}

.grams-field::-webkit-outer-spin-button,
.grams-field::-webkit-inner-spin-button,
.karat-field::-webkit-outer-spin-button,
.karat-field::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.grams-field:focus,
.karat-field:focus {
    outline: none;
    border-color: #000000;
}

.input-label {
    font-size: 13px;
    color: #666666;
    font-weight: 500;
}

/* Slider track section */
.slider-track-section {
    position: relative;
    padding: 8px 0 4px;
}

.karat-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 28px;
    background: transparent;
    outline: none;
    margin: 0;
    padding: 0;
    direction: ltr;
    border: none;
    cursor: pointer;
}

/* Webkit (Chrome, Safari, Edge) - Track with CSS variable fill */
.gold-slider-calculator .karat-range::-webkit-slider-runnable-track {
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(to right, #D4AF37 var(--fill-pct, 100%), #e8e8e8 var(--fill-pct, 100%));
}

.silver-slider-calculator .karat-range::-webkit-slider-runnable-track {
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(to right, #b0b0b0 var(--fill-pct, 100%), #e8e8e8 var(--fill-pct, 100%));
}

/* Webkit - Thumb */
.karat-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(212, 175, 55, 0.3);
    background: radial-gradient(circle at 35% 35%, #f0d86e, #D4AF37 50%, #b8922e);
    margin-top: -9px;
    transition: box-shadow 0.2s ease, transform 0.1s ease;
}

.karat-range::-webkit-slider-thumb:hover {
    box-shadow: 0 3px 12px rgba(212, 175, 55, 0.5), 0 0 0 2px rgba(212, 175, 55, 0.3);
    transform: scale(1.1);
}

.karat-range::-webkit-slider-thumb:active {
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.6), 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.silver-slider-calculator .karat-range::-webkit-slider-thumb {
    background: radial-gradient(circle at 35% 35%, #e8e8e8, #c0c0c0 50%, #999999);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(160, 160, 160, 0.3);
}

.silver-slider-calculator .karat-range::-webkit-slider-thumb:hover {
    box-shadow: 0 3px 12px rgba(160, 160, 160, 0.5), 0 0 0 2px rgba(160, 160, 160, 0.3);
}

/* Firefox - Thumb */
.karat-range::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(212, 175, 55, 0.3);
    background: radial-gradient(circle at 35% 35%, #f0d86e, #D4AF37 50%, #b8922e);
}

.silver-slider-calculator .karat-range::-moz-range-thumb {
    background: radial-gradient(circle at 35% 35%, #e8e8e8, #c0c0c0 50%, #999999);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(160, 160, 160, 0.3);
}

/* Firefox - Track */
.karat-range::-moz-range-track {
    height: 10px;
    border-radius: 5px;
    background: #e8e8e8;
    border: none;
}

/* Firefox - filled portion (native, always aligned with thumb) */
.gold-slider-calculator .karat-range::-moz-range-progress {
    height: 10px;
    border-radius: 5px 0 0 5px;
    background: #D4AF37;
    border: none;
}

.silver-slider-calculator .karat-range::-moz-range-progress {
    height: 10px;
    border-radius: 5px 0 0 5px;
    background: #b0b0b0;
    border: none;
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding: 0;
    direction: ltr;
}

.slider-tick {
    font-size: 11px;
    font-weight: 600;
    color: #bbbbbb;
    cursor: pointer;
    transition: color 0.2s ease;
    text-align: center;
}

.slider-tick.active {
    color: #000000;
}

/* Slider result table — inherits from .gold-price-table / .silver-price-table */
.slider-result-prices {
    margin-top: 16px;
}

.slider-result-prices tbody td {
    font-weight: 700;
}

/* Desktop only adjustments */
@media screen and (min-width: 769px) {
    .gold-slider-calculator .slider-result-prices tbody td {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .gold-slider-calculator {
        padding-bottom: 38px;
    }
}

.slider-result-desc {
    font-size: 11px;
    color: #666666;
    margin-top: 6px;
    text-align: center;
}

.slider-whatsapp-btn {
    padding: 6px 16px;
    font-size: 13px;
}

/* Separator between slider and table */
.slider-separator {
    height: 28px;
    background: repeating-linear-gradient(
        -45deg,
        #d0d0d0,
        #d0d0d0 1px,
        #f0f0f0 1px,
        #f0f0f0 8px
    );
    border-top: 1px solid #c0c0c0;
    border-bottom: 1px solid #c0c0c0;
}

/* Responsive Slider */
@media screen and (max-width: 768px) {
    .slider-calculator {
        padding: 16px 15px 20px;
    }

    .slider-header-row {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }

    .slider-title {
        width: 100%;
        text-align: center;
        margin-left: 0;
    }

    .grams-field, .karat-field {
        padding: calc(var(--em-input-padding-y) / 1.5) var(--em-input-padding-x)!important;
    }

    /* Hide alternating ticks on mobile — keep 1K, 6K, 12K, 18K, 24K for gold */
    .gold-slider-calculator .slider-tick:nth-child(2),
    .gold-slider-calculator .slider-tick:nth-child(4),
    .gold-slider-calculator .slider-tick:nth-child(6),
    .gold-slider-calculator .slider-tick:nth-child(8) {
        display: none;
    }

    /* Silver: keep 1, 400, 800, 999 — hide 200, 600 */
    .silver-slider-calculator .slider-tick:nth-child(2),
    .silver-slider-calculator .slider-tick:nth-child(4) {
        display: none;
    }

    .slider-tick {
        font-size: 10px;
    }

    .slider-separator {
        height: 18px;
    }

    .slider-result-prices,
    .slider-result-prices tr,
    .slider-result-prices td,
    .slider-result-prices th {
        width: 100%;
        min-width: 100%;
    }

    .gold-slider-calculator .slider-result-prices th,
    .gold-slider-calculator .slider-result-prices td {
        width: 33.33% !important;
    }

}

@media screen and (max-width: 480px) {
    .slider-tick {
        font-size: 9px;
    }
}

/* Currency Ticker Styles */
.currency-ticker-wrapper {
    width: 100%;
    overflow: hidden;
    background: #000000;
    padding: 12px 0;
    border-top: 2px solid #D4AF37;
    border-bottom: 2px solid #D4AF37;
    position: relative;
    direction: ltr;
}

.currency-ticker {
    display: flex;
    animation: scroll-rtl linear infinite;
    white-space: nowrap;
    will-change: transform;
    /* Animation duration set dynamically via JavaScript */
}

.currency-ticker:hover {
    animation-play-state: paused;
}

@keyframes scroll-rtl {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-50%);
    }
}

.currency-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 30px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    direction: rtl;
}

.currency-flag {
    font-size: 20px;
}

.currency-flag img {
    min-width: 1em !important;
    min-height: 1em !important
}

.currency-code {
    font-weight: 700;
    color: #D4AF37;
}

.currency-name {
    color: #cccccc;
    font-size: 13px;
}

.currency-rate {
    font-weight: 600;
    color: #ffffff;
    font-family: 'Courier New', monospace;
}

@media (max-width: 500px) {
    .currency-rate {
        line-height: 1;
        margin-top: 3px;
    }
}

/* WhatsApp Button Styles */
.silver-whatsapp {
    padding: 16px;
    text-align: center;
    background: #f8f8f8;
    border-top: 1px solid #e0e0e0;
}

.whatsapp-btn {
    display: inline-block;
    background: linear-gradient(135deg, #25D366 0%, #1EBE57 100%);
    color: #ffffff;
    padding: 8px 24px;
    border-radius: 0;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.25);
    letter-spacing: 0.3px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.whatsapp-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.5s ease;
}

.whatsapp-btn:hover::before {
    left: 100%;
}

.whatsapp-btn:hover {
    background: linear-gradient(135deg, #1EBE57 0%, #128C7E 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
    color: #ffffff;
}

.whatsapp-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

/* WhatsApp Share Button */
.whatsapp-share-wrapper {
    text-align: center;
    margin: 20px 0;
}

.whatsapp-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #25D366 0%, #1EBE57 100%);
    color: #ffffff;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    letter-spacing: 0.3px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.whatsapp-share-btn svg {
    flex-shrink: 0;
}

.whatsapp-share-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.5s ease;
}

.whatsapp-share-btn:hover::before {
    left: 100%;
}

.whatsapp-share-btn:hover {
    background: linear-gradient(135deg, #1EBE57 0%, #128C7E 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.5);
    color: #ffffff;
}

.whatsapp-share-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

/* Responsive for Currency Ticker */
@media screen and (max-width: 768px) {
    .currency-item {
        padding: 0 20px;
        font-size: 12px;
    }

    .currency-flag {
        font-size: 16px;
    }

    .currency-name {
        display: none;
    }

    .whatsapp-btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    .whatsapp-share-btn {
        padding: 10px 20px;
        font-size: 14px;
        gap: 8px;
    }

    .whatsapp-share-btn svg {
        width: 18px;
        height: 18px;
    }
}
