/* فونت و تنظیمات اولیه */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', sans-serif;
}

#jr-shipping-calculator {
    max-width: 900px;
    margin: 40px auto;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    border: 1px solid #eaeaea;
}

/* هدر */
.jr-calc-header {
    background: linear-gradient(135deg, #FFD700 0%, #FFC107 100%);
    color: #2C3E50;
    padding: 30px 40px;
    position: relative;
    overflow: hidden;
}

.jr-header-inner {
    position: relative;
    z-index: 2;
}

.jr-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.jr-logo-icon {
    font-size: 48px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.jr-company-name {
    font-size: 28px;
    font-weight: 900;
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

.jr-tagline {
    font-size: 16px;
    opacity: 0.9;
    margin-top: 5px;
}

/* فرم */
.jr-calc-form {
    padding: 30px;
}

.jr-section {
    margin-bottom: 35px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
    border-right: 4px solid #FFD700;
}

.jr-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.2);
}

.jr-section-icon {
    font-size: 24px;
    color: #FFD700;
}

.jr-section-title h3 {
    font-size: 20px;
    color: #2C3E50;
    margin: 0;
}

/* ورودی شهرها */
.jr-city-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: end;
}

@media (max-width: 768px) {
    .jr-city-inputs {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .jr-swap-container {
        grid-row: 2;
        text-align: center;
    }
}

.jr-input-group {
    position: relative;
}

.jr-input-group label {
    display: block;
    margin-bottom: 8px;
    color: #2C3E50;
    font-weight: 600;
    font-size: 14px;
}

.jr-autocomplete {
    position: relative;
}

.jr-autocomplete input[type="text"] {
    width: 100%;
    padding: 14px 45px 14px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    background: white;
    color: #333;
}

.jr-autocomplete input[type="text"]:focus {
    border-color: #FFD700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
    outline: none;
}

.jr-input-hint {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    text-align: right;
}

.jr-results-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.jr-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.jr-result-item:hover {
    background: #FFF9C4;
}

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

.jr-city-name {
    font-weight: 600;
    color: #2C3E50;
}

.jr-city-province {
    font-size: 12px;
    color: #666;
}

/* دکمه جابجایی */
.jr-swap-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #2C3E50;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.jr-swap-btn:hover {
    background: #FFD700;
    color: #2C3E50;
    transform: rotate(180deg) scale(1.1);
}

/* انتخاب وسیله */
.jr-vehicle-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.jr-vehicle-option input[type="radio"] {
    display: none;
}

.jr-vehicle-option label {
    display: block;
    padding: 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    position: relative;
}

.jr-vehicle-option input[type="radio"]:checked + label {
    border-color: #FFD700;
    background: #FFFDE7;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 215, 0, 0.15);
}

.jr-vehicle-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
}

.jr-vehicle-name {
    display: block;
    font-weight: 700;
    color: #2C3E50;
    margin-bottom: 5px;
    font-size: 16px;
}

.jr-vehicle-capacity {
    font-size: 13px;
    color: #666;
}

/* خدمات اضافی */
.jr-extra-services {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.jr-checkbox-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
    flex: 1;
    min-width: 200px;
}

.jr-checkbox-option:hover {
    border-color: #FFD700;
    background: #FFFDE7;
}

.jr-checkbox-option input[type="checkbox"] {
    display: none;
}

.jr-checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid #ddd;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s;
}

.jr-checkbox-option input[type="checkbox"]:checked + .jr-checkmark {
    background: #FFD700;
    border-color: #FFD700;
}

.jr-checkbox-option input[type="checkbox"]:checked + .jr-checkmark::after {
    content: '✓';
    position: absolute;
    color: #2C3E50;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.jr-option-label {
    flex: 1;
    font-weight: 600;
    color: #2C3E50;
}

.jr-option-price {
    background: #E8F5E9;
    color: #2E7D32;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    margin-right: 5px;
}

/* دکمه محاسبه */
.jr-calc-actions {
    text-align: center;
    margin: 40px 0 20px;
}

.jr-calc-button {
    background: linear-gradient(135deg, #FFD700 0%, #FFC107 100%);
    color: #2C3E50;
    border: none;
    padding: 18px 50px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.jr-calc-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(255, 215, 0, 0.4);
}

.jr-calc-button:active {
    transform: translateY(-1px);
}

.jr-button-text {
    position: relative;
    z-index: 2;
}

.jr-button-icon {
    font-size: 22px;
    position: relative;
    z-index: 2;
}

.jr-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(44, 62, 80, 0.2);
    border-top-color: #2C3E50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* نتایج */
.jr-results-wrapper {
    margin: 30px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px solid #FFD700;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.jr-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
}

.jr-results-header h3 {
    margin: 0;
    color: #2C3E50;
    font-size: 22px;
}

.jr-print-btn {
    background: #2C3E50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.jr-print-btn:hover {
    background: #1a252f;
    transform: translateY(-2px);
}

.jr-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.jr-result-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s;
    border-top: 4px solid;
}

.jr-result-card:hover {
    transform: translateY(-5px);
}

.jr-distance-card {
    border-top-color: #3498db;
}

.jr-base-card {
    border-top-color: #2ecc71;
}

.jr-total-card {
    border-top-color: #e74c3c;
}

.jr-card-icon {
    font-size: 36px;
    margin-bottom: 15px;
}

.jr-card-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.jr-card-value {
    font-size: 28px;
    font-weight: 900;
    color: #2C3E50;
    margin: 5px 0;
    direction: ltr;
    display: inline-block;
}

.jr-card-unit {
    font-size: 12px;
    color: #999;
}

.jr-results-details {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
}

.jr-details-table {
    width: 100%;
    border-collapse: collapse;
}

.jr-details-table tr {
    border-bottom: 1px solid #eee;
}

.jr-details-table tr:last-child {
    border-bottom: none;
}

.jr-details-table td {
    padding: 12px 5px;
    color: #2C3E50;
}

.jr-details-table td:first-child {
    font-weight: 600;
    color: #666;
    width: 40%;
}

.jr-results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.jr-action-btn {
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.jr-primary-btn {
    background: #FFD700;
    color: #2C3E50;
}

.jr-primary-btn:hover {
    background: #FFC107;
    transform: translateY(-2px);
}

.jr-secondary-btn {
    background: #2C3E50;
    color: white;
}

.jr-secondary-btn:hover {
    background: #1a252f;
    transform: translateY(-2px);
}

/* پیام خطا */
.jr-error-box {
    margin: 30px;
    padding: 20px;
    background: #FFEBEE;
    border: 2px solid #F44336;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 20px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.jr-error-icon {
    font-size: 32px;
    color: #F44336;
}

.jr-error-content h4 {
    color: #C62828;
    margin: 0 0 5px 0;
    font-size: 18px;
}

.jr-error-content p {
    color: #666;
    margin: 0;
}

/* فوتر */
.jr-calc-footer {
    background: #2C3E50;
    color: white;
    padding: 30px 40px;
}

.jr-contact-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.jr-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.jr-contact-icon {
    color: #FFD700;
    font-size: 18px;
}

.jr-contact-text {
    font-size: 15px;
}

.jr-copyright {
    text-align: center;
    font-size: 14px;
    opacity: 0.8;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* رسپانسیو */
@media (max-width: 768px) {
    #jr-shipping-calculator {
        margin: 20px;
        border-radius: 10px;
    }
    
    .jr-calc-header {
        padding: 20px;
    }
    
    .jr-logo {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .jr-company-name {
        font-size: 22px;
    }
    
    .jr-calc-form {
        padding: 20px;
    }
    
    .jr-section {
        padding: 20px;
    }
    
    .jr-vehicle-options {
        grid-template-columns: 1fr;
    }
    
    .jr-extra-services {
        flex-direction: column;
    }
    
    .jr-checkbox-option {
        min-width: 100%;
    }
    
    .jr-results-grid {
        grid-template-columns: 1fr;
    }
    
    .jr-results-wrapper {
        margin: 20px;
        padding: 20px;
    }
    
    .jr-contact-info {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}