/**
 * Saif Truck Calculator Styles
 * 
 * CRITICAL: Limited to .saif-calculator-wrapper to avoid theme conflicts
 */

/* 1. Container & Scoping */
.saif-calculator-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    direction: rtl;
    text-align: right;
}

/* 2. Breadcrumb */
.saif-calculator-wrapper .saif-breadcrumb {
    margin-bottom: 20px;
    padding: 10px 0;
    font-size: 14px;
    color: #666;
}

.saif-calculator-wrapper .saif-breadcrumb a {
    color: #2563eb;
    text-decoration: none;
}

.saif-calculator-wrapper .saif-breadcrumb a:hover {
    text-decoration: underline;
}

/* 3. Calculator Header */
.saif-calculator-wrapper .saif-calc-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: 12px;
    color: white;
}

.saif-calculator-wrapper .calc-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.saif-calculator-wrapper .calc-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: white;
}

.saif-calculator-wrapper .calc-subtitle {
    font-size: 16px;
    margin: 0;
    opacity: 0.95;
}

/* 4. Form Sections */
.saif-calculator-wrapper .calc-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.saif-calculator-wrapper .section-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
}

.saif-calculator-wrapper .section-icon {
    font-size: 24px;
}

/* 5. Form Grid */
.saif-calculator-wrapper .form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.saif-calculator-wrapper .form-field.full-width {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .saif-calculator-wrapper .form-grid {
        grid-template-columns: 1fr;
    }
}

/* 6. Form Controls */
.saif-calculator-wrapper .form-field {
    display: flex;
    flex-direction: column;
}

.saif-calculator-wrapper .form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.saif-calculator-wrapper .required {
    color: #dc2626;
}

.saif-calculator-wrapper .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: #fff;
}

.saif-calculator-wrapper .form-control:focus {
    outline: none;
    border-color: #2563eb;
}

.saif-calculator-wrapper .help-text {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: #6b7280;
}

/* 7. Port Selection Cards */
.saif-calculator-wrapper .port-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.saif-calculator-wrapper .dest-ports {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

@media (max-width: 768px) {
    .saif-calculator-wrapper .port-options {
        grid-template-columns: 1fr;
    }
}

.saif-calculator-wrapper .port-card {
    position: relative;
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: #fff;
}

.saif-calculator-wrapper .port-card:hover {
    border-color: #2563eb;
    background: #f0f9ff;
}

.saif-calculator-wrapper .port-card input[type="radio"] {
    margin-left: 10px;
    cursor: pointer;
}

.saif-calculator-wrapper .port-card input[type="radio"]:checked~.port-info {
    color: #2563eb;
}

.saif-calculator-wrapper .port-card input[type="radio"]:checked~.port-info strong {
    color: #1d4ed8;
}

.saif-calculator-wrapper .port-info {
    display: flex;
    flex-direction: column;
    transition: color 0.3s;
}

.saif-calculator-wrapper .port-info strong {
    font-size: 15px;
    margin-bottom: 3px;
}

.saif-calculator-wrapper .port-info small {
    font-size: 13px;
    color: #6b7280;
}

/* 8. Calculate Button */
.saif-calculator-wrapper .btn-calculate {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.saif-calculator-wrapper .btn-calculate:hover {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.saif-calculator-wrapper .btn-calculate:active {
    transform: translateY(0);
}

.saif-calculator-wrapper .btn-icon {
    font-size: 20px;
}

/* 9. Results Section */
.saif-calculator-wrapper .calc-results {
    margin-top: 30px;
    animation: slideDown 0.4s ease-out;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 25px;
}

.saif-calculator-wrapper .calc-results h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #1e3a8a;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-breakdown .result-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #dbeafe;
}

.results-breakdown .result-row:last-child {
    border-bottom: none;
}

.results-breakdown .result-label {
    color: #4b5563;
}

.results-breakdown .result-value {
    font-weight: bold;
    color: #1e40af;
}

.results-breakdown .result-row.total {
    margin-top: 15px;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border-top: 2px solid #2563eb;
}

.results-breakdown .result-row.total .result-value {
    color: #16a34a;
    font-size: 20px;
}

.shipping-time {
    text-align: center;
    margin-top: 15px;
    background: #fffbeb;
    padding: 10px;
    border-radius: 6px;
    color: #92400e;
}

.disclaimer {
    margin-top: 20px;
    font-size: 13px;
    color: #713f12;
    background: #fef3c7;
    padding: 15px;
    border-right: 4px solid #ea580c;
    border-radius: 6px;
}

.disclaimer h4 {
    margin: 0 0 5px 0;
    color: #9a3412;
}

.cta-buttons {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 15px;
    margin-top: 25px;
}

.btn-whatsapp {
    background: #25D366;
    color: white;
    text-align: center;
    padding: 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-whatsapp:hover {
    background: #128C7E;
}

.btn-secondary {
    background: white;
    color: #2563eb;
    border: 2px solid #2563eb;
    text-align: center;
    padding: 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #2563eb;
    color: white;
}

.loader {
    width: 20px;
    height: 20px;
    border: 3px solid #FFF;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@media (max-width: 600px) {
    .cta-buttons {
        grid-template-columns: 1fr;
    }

    .saif-calculator-wrapper .calc-title {
        font-size: 20px;
    }

    .saif-calculator-wrapper .saif-calc-header {
        padding: 20px 15px;
    }
}

/* 10. Enhanced WhatsApp CTA */
.whatsapp-cta-section {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    margin: 30px 0;
    color: white;
}

.whatsapp-cta-section h4 {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.whatsapp-cta-section p {
    margin: 0 0 20px 0;
    opacity: 0.95;
    font-size: 15px;
}

.btn-whatsapp-quote,
a.btn-whatsapp-quote {
    background: white !important;
    color: #25D366 !important;
    border: 2px solid white !important;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.btn-whatsapp-quote:hover,
a.btn-whatsapp-quote:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    background: #f0f0f0 !important;
    color: #128C7E !important;
    text-decoration: none;
}

.whatsapp-icon {
    font-size: 24px;
}

@media (max-width: 768px) {
    .whatsapp-cta-section {
        padding: 20px 15px;
    }

    .whatsapp-cta-section h4 {
        font-size: 18px;
    }

    .btn-whatsapp-quote {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* 11. Freshness & TOC Fixes */
.freshness-statement {
    background: #fef3c7;
    border-right: 4px solid #f59e0b;
    padding: 12px 15px;
    margin: 20px 0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.freshness-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.freshness-text {
    color: #92400e;
    line-height: 1.5;
}

/* Hide TOC on mobile */
@media (max-width: 768px) {

    .ez-toc-container,
    #ez-toc-container,
    .toc_widget_list {
        display: none !important;
    }
}