/**
 * Gold Calculator Styles
 * Matches mockup designs for buy and sell gold pages
 */

/* ==========================================================================
   Container & Layout
   ========================================================================== */

.gold-calculator-page {
    direction: rtl;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    padding: 0px 20px 40px 20px;
    width: 100%;
    overflow-x: hidden;
}

.gold-calculator-container {
    max-width: var(--pls-container-width);
    margin: 0 auto;
    overflow-x: hidden;
}

/* ==========================================================================
   Header
   ========================================================================== */

.gold-calculator-header {
    margin-bottom: 40px;
    padding: 0;
    background: #fff;
}

.gold-calculator-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.gold-current-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: #F8F7F7;
    margin-bottom: 24px;
    gap: 20px;
    border-radius: var(--pls-border-radius);
}

.gold-current-price .price-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
}

.gold-current-price .price-label {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.gold-current-price small {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.gold-current-price .price-value {
    font-size: 17px;
    font-weight: 700;
    background: linear-gradient(135deg, #C8A870 0%, #D4B887 100%);
    padding: 4px 20px;
    color: #fff;
    white-space: nowrap;
    border-radius: var(--pls-border-radius);
}

/* ==========================================================================
   Content Layout
   ========================================================================== */

.gold-calculator-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 100%;
    overflow-x: hidden;
}

.gold-calculator-form-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    max-width: 100%;
    overflow-x: hidden;
}

.gold-calculator-form-wrapper .gold-current-price {
    width: 100%;
    margin-bottom: 0;
}

.gold-calculator-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ==========================================================================
   Calculator Form (Left Side)
   ========================================================================== */

.gold-calculator-form {
    background: #fff;
}

.calculator-field {
    margin-bottom: 24px;
}

.calculator-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.gold-karat-select,
.gold-weight-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-size: 16px;
    border: 1px solid #E0E0E0;
    background: #F9F9F9;
    transition: all 0.3s ease;
}

.gold-karat-select:focus,
.gold-weight-input:focus {
    outline: none;
    border-color: #C8A870;
    background: #fff;
}

/* ==========================================================================
   Total Display
   ========================================================================== */

.calculator-total {
    margin: 32px 0 12px 0;
    padding: 20px 24px;
    background: #F8F7F7;
    display: flex;
    align-items: center;
    border-radius: var(--pls-border-radius);
    justify-content: space-between;
    gap: 20px;
}

.total-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
}

.total-label {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.total-breakdown {
    text-align: right;
}

.total-breakdown small {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.total-breakdown #price-per-gram {
    font-weight: 600;
    color: #C8A870;
}

.total-amount {
    flex-shrink: 0;
}

.amount-value {
    font-size: 24px;
    font-weight: 700;
    color: #000;
    white-space: nowrap;
}

.calculator-disclaimer {
    font-size: 12px;
    color: #999;
    text-align: center;
    margin: 16px 0 24px;
    line-height: 1.5;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.gold-submit-btn,
.gold-contact-btn {
    width: 100%;
    height: 56px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

/* Call Button (Phone Link) - Always Enabled */
.gold-call-btn {
    flex-direction: row-reverse;
}

.buy-gold-page .gold-call-btn {
    background: linear-gradient(135deg, #C8A870 0%, #D4B887 100%);
    color: #fff;
    border-radius: var(--pls-border-radius);
}

.buy-gold-page .gold-call-btn:hover {
    border: 1px solid #C8A870;
    color: #C8A870;
    background: #fff;
}


.gold-call-btn .phone-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.gold-call-btn .phone-icon path {
    fill: currentColor;
}

/* Contact Form Button - Black, Disabled Initially */
.gold-contact-btn {
    background: #000;
    color: #fff;
    border: none;
    margin-top: 12px;
}

.gold-contact-btn:hover:not(:disabled) {
    border: 1px solid #000;
    color: #000;
    background: #fff;
}

.gold-contact-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.calculator-or {
    text-align: center;
    margin: 16px 0;
    font-size: 14px;
    color: #999;
    position: relative;
}

.calculator-or::before,
.calculator-or::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #E0E0E0;
}

.calculator-or::before {
    right: 0;
}

.calculator-or::after {
    left: 0;
}

/* ==========================================================================
   Contact Form Section
   ========================================================================== */

.contact-form-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 2px solid #E0E0E0;
}

.contact-form-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px;
    color: #1a1a1a;
}

.form-summary {
    background: #F9F9F9;
    padding: 20px;
    margin-bottom: 24px;
    border-right: 4px solid #C8A870;
    border-radius: var(--pls-border-radius);
}

.form-summary h4 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #333;
}

.form-summary p {
    margin: 8px 0;
    font-size: 14px;
    color: #666;
}

.form-summary strong {
    color: #1a1a1a;
    font-weight: 600;
}

.form-summary .summary-total {
    color: #C8A870;
    font-size: 18px;
}

/* ==========================================================================
   Sidebar (Right Side)
   ========================================================================== */

.gold-calculator-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-box {
    background: #f8f7f7;
    padding: 24px;
    border-radius: var(--pls-border-radius);
}

.sidebar-box h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    padding-bottom: 12px;
}

.process-list,
.benefits-list,
.coverage-list,
.accepted-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: list-counter;
}

.process-list li,
.benefits-list li,
.coverage-list li,
.accepted-list li {
    padding: 12px 42px 8px 0;
    font-size: 16px;
    color: #333;
    line-height: 1.6;
    position: relative;
    counter-increment: list-counter;
}

.process-list li::before,
.benefits-list li::before,
.coverage-list li::before,
.accepted-list li::before {
    content: counter(list-counter);
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: #C8A870;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.sidebar-contact {
    background: #f8f7f7;
    padding: 24px;
    color: #000;
    border-radius: var(--pls-border-radius);
}

.sidebar-contact h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px;
    color: #000;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 12px;
}

.sidebar-contact .contact-info {
    font-size: 16px;
    line-height: 1.8;
    margin: 0;
}

.sidebar-contact .contact-info strong {
    display: block;
    margin-top: 8px;
}

.sidebar-contact .phone-link {
    color: #C8A870;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.sidebar-contact .phone-link:hover {
    color: #D4B887;
    text-decoration: underline;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media screen and (max-width: 968px) {
    .gold-calculator-content {
        grid-template-columns: 1fr;
    }

    .gold-calculator-form-wrapper {
        order: 1;
        position: static;
    }

    .gold-calculator-sidebar {
        order: 2;
    }
}

@media screen and (max-width: 768px) {

    .gold-calculator-header {
        margin-bottom: 20px;
    }

    .gold-calculator-page {
        padding: 20px 15px;
    }

    .gold-calculator-header h1 {
        font-size: 24px;
    }

    .gold-calculator-form {
        padding: 24px 0px 0px 0px;
    }

    .sidebar-box {
        padding: 24px 16px;
    }

    .gold-calculator-content {
        gap: 20px;
    }

    .gold-submit-btn,
    .gold-contact-btn {
        border-radius: var(--pls-border-radius);
    }
}

@media screen and (max-width: 480px) {
    .gold-calculator-header h1 {
        font-size: 24px;
    }

    .gold-current-price {
        flex-direction: column;
        text-align: flex-start;
        gap: 12px;
    }

    .gold-current-price .price-info {
        text-align: center;
    }

    .gold-current-price .price-value {
        font-size: 15px;
        padding: 3px 17px;
    }

    .calculator-total {
        flex-direction: column;
        text-align: center;
        gap: 4px;
        align-items: flex-start;
    }

    .calculator-total .total-info {
        text-align: center;
    }

    .calculator-total .total-breakdown {
        text-align: right;
    }

    .calculator-total .amount-value {
        font-size: 20px;
    }

    .calculator-or::before,
    .calculator-or::after {
        width: 35%;
    }

    .amount-value {
        font-size: 28px;
    }
}

/* ==========================================================================
   CF7 Form Styling
   ========================================================================== */

.contact-form-section .wpcf7-form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid #E0E0E0;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.contact-form-section .wpcf7-form-control:focus {
    outline: none;
    border-color: #C8A870;
}

.contact-form-section .wpcf7-submit {
    width: 100%;
    height: 56px;
    background: #C8A870;
    color: #fff;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.contact-form-section .wpcf7-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(200, 168, 112, 0.4);
}

.contact-form-section .wpcf7-not-valid-tip {
    color: #ff4757;
    font-size: 13px;
    margin-top: 4px;
}

/* ==========================================================================
   Sell Gold Page - Blue Theme (#233f51)
   ========================================================================== */

.sell-gold-page .gold-current-price .price-value {
    background: #233f51;
}

.sell-gold-page .gold-karat-select:focus,
.sell-gold-page .gold-weight-input:focus {
    border-color: #233f51;
}

.sell-gold-page .total-breakdown #price-per-gram {
    color: #233f51;
}

.sell-gold-page .gold-call-btn {
    background: #233f51;
    color: #fff;
}

.sell-gold-page .gold-call-btn:hover {
    background: #2a4a5e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(35, 63, 81, 0.4);
}

.sell-gold-page .form-summary {
    border-right: 4px solid #233f51;
}

.sell-gold-page .form-summary .summary-total {
    color: #233f51;
}

.sell-gold-page .process-list li::before,
.sell-gold-page .benefits-list li::before,
.sell-gold-page .coverage-list li::before,
.sell-gold-page .accepted-list li::before {
    background: #233f51;
}

.sell-gold-page .sidebar-contact .phone-link {
    color: #233f51;
}

.sell-gold-page .sidebar-contact .phone-link:hover {
    color: #2a4a5e;
}

.sell-gold-page .contact-form-section .wpcf7-submit {
    background: #233f51;
}

.sell-gold-page .contact-form-section .wpcf7-submit:hover {
    box-shadow: 0 6px 16px rgba(35, 63, 81, 0.4);
}

/* ==========================================================================
   Form Success Message
   ========================================================================== */

.gold-calculator-success-message {
    background: #f0faf0;
    border: 1px solid #a5d6a7;
    border-radius: 12px;
    padding: 28px 24px;
    text-align: center;
    margin-top: 16px;
}

.gold-calculator-success-message .success-icon {
    width: 52px;
    height: 52px;
    background: #4CAF50;
    color: #fff;
    border-radius: 50%;
    font-size: 26px;
    line-height: 52px;
    margin: 0 auto 14px;
}

.gold-calculator-success-message p {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: #2e7d32;
}

.gold-calculator-success-message .success-sub {
    font-size: 14px;
    font-weight: 400;
    color: #555;
    margin: 0;
}

/* ==========================================================================
   UX Animations - Loading & Update Effects
   ========================================================================== */

/* Loading state animation */
.calculating {
    position: relative;
    opacity: 0.6;
    animation: calculating-pulse 1s ease-in-out infinite;
}

@keyframes calculating-pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.3;
    }
}

/* Pulse update animation */
.pulse-update {
    animation: pulse-effect 0.6s ease-out;
}

@keyframes pulse-effect {
    0% {
        transform: scale(1);
        color: inherit;
    }
    25% {
        transform: scale(1.05);
        color: #4CAF50;
        text-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
    }
    50% {
        transform: scale(1.08);
        color: #4CAF50;
        text-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
    }
    75% {
        transform: scale(1.03);
        color: #4CAF50;
    }
    100% {
        transform: scale(1);
        color: inherit;
        text-shadow: none;
    }
}

/* Smooth transitions for all calculator values */
.amount-value,
#price-per-gram,
#weight-display {
    transition: all 0.3s ease;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {

    .gold-calculator-sidebar,
    .gold-submit-btn,
    .gold-contact-btn,
    .calculator-or {
        display: none;
    }
}

/* ==========================================================================
   Multi-Karat Buy Table
   ========================================================================== */

.grand-total-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f7f7;
    color: #1a1a1a;
    padding: 20px 28px;
    border-radius: var(--pls-border-radius);
    margin-top: 0;
    direction: rtl;
}

.grand-total-label {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

.grand-total-value {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 0.5px;
}

.gold-karat-table-wrapper {
    overflow-x: auto;
    border-radius: 0;
    border: none;
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.gold-karat-table {
    width: 100%;
    border-collapse: collapse;
    direction: rtl;
    font-size: 15px;
    margin-bottom: 0 !important;
    border: 1px solid #e8e0d0;
}

.gold-karat-table thead tr {
    background: #f8f7f7;
    color: #1a1a1a;
}

.gold-karat-table thead th {
    padding: 14px 16px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    border: none;
    border-radius: 0 !important;
}

.gold-karat-table thead th:first-child {
    text-align: right;
}

.gold-karat-table tbody tr {
    border-bottom: 1px solid #f0e8d5;
    transition: background 0.15s ease;
    border-left: none;
    border-right: none;
    border-top: none;
}

.gold-karat-table tbody tr:last-child {
    border-bottom: none;
}

.gold-karat-table tbody td {
    padding: 14px 16px;
    text-align: center;
    color: #1a1a1a;
    vertical-align: middle;
}

.gold-karat-table tbody td:first-child {
    text-align: right;
}

.karat-badge {
    display: inline-block;
    background: #c9a84c;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    min-width: 46px;
    text-align: center;
    letter-spacing: 0.3px;
}

.gold-karat-table .market-price {
    color: #555;
    font-size: 14px;
}

.gold-karat-table .buy-price {
    color: #1a6b1a;
    font-weight: 600;
}

.karat-weight {
    width: 90px;
    padding: 7px 10px;
    border: 1px solid #d5c9a8;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    color: #1a1a1a;
    background: #fff;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}

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

.karat-weight:focus {
    outline: none;
    border-color: #c9a84c;
    box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.2);
}

.row-total {
    font-weight: 600;
    color: #c9a84c;
    white-space: nowrap;
}

/* Summary list inside form section */
.buy-summary-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    direction: rtl;
}

.buy-summary-list li {
    padding: 6px 0;
    font-size: 14px;
    color: #444;
    border-bottom: 1px dashed #e5e5e5;
    display: flex;
    align-items: center;
    gap: 6px;
}

.buy-summary-list li:last-child {
    border-bottom: none;
}

/* Loading state for prices */
.gold-karat-table tbody.loading-prices .buy-price {
    position: relative;
    color: transparent;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    min-height: 20px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.gold-karat-table tbody.loading-prices .karat-weight {
    pointer-events: none;
    opacity: 0.6;
}

/* Mobile adjustments */
@media screen and (max-width: 768px) {
    .gold-calculator-form-wrapper {
        max-width: 100%;
        overflow: hidden;
    }

    .gold-karat-table-wrapper {
        margin-left: 0;
        margin-right: 0;
    }

    .grand-total-display {
        padding: 12px 16px;
        border-radius: 0;
    }

    .grand-total-label {
        font-size: 14px;
    }

    .grand-total-value {
        font-size: 20px;
    }

    .gold-karat-table {
        font-size: 12px;
    }

    .gold-karat-table thead th {
        padding: 8px 6px;
        font-size: 11px;
        white-space: normal;
        word-break: break-word;
        line-height: 1.3;
    }

    .gold-karat-table tbody td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .karat-weight {
        width: 60px;
        padding: 5px 4px;
        font-size: 12px;
    }

    .karat-badge {
        font-size: 11px;
        padding: 2px 8px;
        min-width: 40px;
    }

    .gold-karat-table .buy-price,
    .gold-karat-table .row-total {
        font-size: 12px;
        white-space: nowrap;
    }
}