/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

.dpw-calculator {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    font-family: 'Vazir', 'Tahoma', sans-serif;
    direction: rtl;
    text-align: right;
    position: relative;
}
.dpw-calculator.dpw-disabled {
    opacity: 0.92;
}
.dpw-calculator-disabled-message {
    background: #f56565;
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.35);
}
.dpw-toast-container {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 20;
    pointer-events: none;
}

.dpw-toast {
    background: rgba(45, 55, 72, 0.92);
    color: #fff;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(6px);
    transition: all 0.2s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
}

.dpw-toast-success {
    background: rgba(22, 163, 74, 0.92);
}

.dpw-toast-error {
    background: rgba(225, 29, 72, 0.92);
}

.dpw-toast-visible {
    opacity: 1;
    transform: translateY(0);
}


.dpw-calculator h2 {
    color: #fff;
    text-align: center;
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: 700;
}

/* Plan Selection Tabs */
.dpw-calculator .dpw-plan-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: #fff !important;
    padding: 4px;
    border-radius: 10px !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1) !important;
}

.dpw-calculator .dpw-plan-tab {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid transparent !important;
    background: #fff !important;
    color: #718096 !important;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px !important;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Vazir', sans-serif !important;
    position: relative;
    text-align: center;
    box-shadow: none !important;
}

.dpw-calculator .dpw-plan-tab-active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(79, 172, 254, 0.28) !important;
    border-color: rgba(79, 172, 254, 0.7) !important;
    transform: translateY(-1px);
    font-weight: 700;
}

.dpw-calculator .dpw-plan-tab:hover:not(.dpw-plan-tab-active) {
    background: #f7fafc !important;
    color: #4a5568 !important;
    border-color: #dbe7ff !important;
}

.dpw-calculator .dpw-plan-tab-active::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    pointer-events: none;
}

.dpw-calculator .dpw-plan-tab-active::before {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 18px;
    font-weight: 700;
    color: #0ea5e9;
    text-shadow: 0 0 4px rgba(14, 165, 233, 0.4);
}

/* Main Content Layout */
.dpw-main-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

/* Info Column (Left) */
.dpw-info-column {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
    height: fit-content;
}

.dpw-plan-info h3 {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    text-align: center;
}

.dpw-info-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dpw-info-plan {
    display: none;
    flex-direction: column;
    gap: 8px;
}

.dpw-info-plan.dpw-info-plan-active {
    display: flex;
}

.dpw-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-right: 3px solid #4facfe;
}

.dpw-info-label {
    font-size: 12px;
    color: #4a5568;
    font-weight: 500;
}

.dpw-info-value {
    font-size: 12px;
    color: #2d3748;
    font-weight: 600;
}

.dpw-info-empty {
    font-size: 12px;
    color: #4a5568;
    font-weight: 500;
    padding: 12px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 8px;
    border-right: 3px solid #cbd5e0;
}

/* Form Column (Right) */
.dpw-form-column {
    background: linear-gradient(135deg, #1f2a44 0%, #2f4d7a 100%);
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.12);
    color: #fff;
}

.dpw-plan-content {
    display: none;
}

.dpw-plan-content.active {
    display: block;
}

/* Form Sections */
.dpw-form-section {
    margin-bottom: 18px;
}

.dpw-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}

.dpw-form-grid .dpw-form-section {
    margin-bottom: 0;
}

.dpw-form-grid + .dpw-form-section {
    margin-top: 16px;
}

.dpw-section-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.dpw-form-section small {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 6px;
    font-style: italic;
}

/* Amount Input */
.dpw-amount-input {
    position: relative;
    display: flex;
    align-items: center;
}

.dpw-amount-input input {
    width: 100%;
    padding: 10px 36px 10px 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-align: right;
    transition: all 0.2s ease;
    font-family: 'Vazir', sans-serif;
}

.dpw-amount-input input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.dpw-currency {
    position: absolute;
    left: 10px;
    color: #718096;
    font-weight: 600;
    font-size: 15px;
}

/* Small Amount Input */
.dpw-amount-input-small {
    max-width: 100px;
}

.dpw-amount-input-small input {
    padding: 6px 26px 6px 6px;
    font-size: 13px;
    text-align: center;
}

.dpw-amount-input-small .dpw-currency {
    left: 6px;
    font-size: 13px;
}

/* Option Buttons */
.dpw-option-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 6px;
}

.dpw-capital-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 6px;
    width: 100%;
}

.dpw-capital-buttons .dpw-option-btn {
    width: 100%;
}

.dpw-calculator .dpw-option-btn {
    padding: 10px 16px;
    border: 2px solid #e2e8f0 !important;
    background: #fff !important;
    color: #4a5568 !important;
    border-radius: 8px !important;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Vazir', sans-serif !important;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: none !important;
}

.dpw-calculator .dpw-option-btn:hover {
    border-color: #4facfe !important;
    color: #4facfe !important;
    background: rgba(79, 172, 254, 0.05) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.15) !important;
}

.dpw-calculator .dpw-option-btn-active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    color: #fff !important;
    border-color: #4facfe !important;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4) !important;
    transform: translateY(-2px);
    font-weight: 700;
}

.dpw-calculator .dpw-option-btn-active:hover {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.5) !important;
}

.dpw-calculator .dpw-option-btn-active::before {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 16px;
    font-weight: 700;
    color: #0ea5e9;
    text-shadow: 0 0 4px rgba(14, 165, 233, 0.4);
}

/* Price Section */
.dpw-price-section {
    background: #fff;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.dpw-currency-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #fff;
}

.dpw-currency-options {
    display: flex;
    gap: 8px;
}

.dpw-currency-option {
    border: 1px solid #cbd5e0;
    background: #f7fafc;
    color: #2d3748;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Vazir', sans-serif;
    font-weight: 600;
}

.dpw-currency-option:hover {
    background: #edf2f7;
}

.dpw-currency-option.active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #fff;
    border-color: #4facfe;
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

.dpw-price-info {
    margin-top: 16px;
}

.dpw-price-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 14px;
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.25);
}

.dpw-price-box h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.dpw-price-amount {
    font-size: 28px;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.dpw-price-secondary {
    margin-top: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.dpw-exchange-note {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
}

.dpw-exchange-updated {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.currency-symbol {
    font-size: 24px;
    vertical-align: top;
    margin-left: 2px;
}

/* Actions */
.dpw-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.dpw-calculator .dpw-actions .dpw-btn {
    padding: 8px 16px;
    border: none !important;
    border-radius: 8px !important;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: 'Vazir', sans-serif !important;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    color: inherit;
}

.dpw-calculator .dpw-actions .dpw-btn-label {
    line-height: 1.2;
    white-space: nowrap;
}

.dpw-calculator .dpw-actions .dpw-btn-icon {
    width: 16px;
    height: 16px;
    background-repeat: no-repeat;
    background-size: 16px 16px;
    background-position: center;
    flex-shrink: 0;
}


.dpw-calculator .dpw-actions .dpw-btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.dpw-calculator .dpw-actions .dpw-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

.dpw-calculator .dpw-actions .dpw-btn-secondary {
    background: #f7fafc !important;
    color: #4a5568 !important;
    border: 2px solid #e2e8f0 !important;
}

.dpw-calculator .dpw-actions .dpw-btn-secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.dpw-calculator .dpw-actions .dpw-btn-danger {
    background: #fff5f5 !important;
    color: #c53030 !important;
    border: 2px solid #feb2b2 !important;
}

.dpw-calculator .dpw-actions .dpw-btn-danger:hover {
    background: #ffeaea;
    border-color: #fc8181;
}

.dpw-calculator .dpw-actions .dpw-hidden {
    display: none !important;
}

.dpw-calculator .dpw-actions .dpw-btn-cart {
    border: 2px solid #63b3ed !important;
    background: #ebf8ff !important;
    color: #2b6cb0 !important;
    text-decoration: none;
}

.dpw-calculator .dpw-actions .dpw-btn-cart:hover {
    background: #bee3f8;
    border-color: #4299e1;
    text-decoration: none;
}

.dpw-calculator .dpw-actions .dpw-btn-cart:focus,
.dpw-calculator .dpw-actions .dpw-btn-cart:active,
.dpw-calculator .dpw-actions .dpw-btn-cart:visited {
    text-decoration: none;
}

.dpw-calculator .dpw-actions .dpw-icon-add {
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%205h2l1.5%209h11l1.5-6H6.5%22/%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2219%22%20r%3D%221.2%22/%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2219%22%20r%3D%221.2%22/%3E%3Cpath%20d%3D%22M12%203v4%22/%3E%3Cpath%20d%3D%22M10%205h4%22/%3E%3C/svg%3E");
}

.dpw-calculator .dpw-actions .dpw-icon-cart {
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%205h2l1.5%209h11l1.5-6H6.5%22/%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2219%22%20r%3D%221.2%22/%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2219%22%20r%3D%221.2%22/%3E%3C/svg%3E");
}

.dpw-calculator .dpw-actions .dpw-icon-reset {
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M6%204l-2%202%202%202%22/%3E%3Cpath%20d%3D%22M4%206h9a5%205%200%2011%200%2010H9%22/%3E%3C/svg%3E");
}

.dpw-calculator .dpw-actions .dpw-icon-empty {
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M5%207h14%22/%3E%3Cpath%20d%3D%22M9%207V5h6v2%22/%3E%3Cpath%20d%3D%22M9%207l1%2012h4l1-12%22/%3E%3Cpath%20d%3D%22M10%2011v6%22/%3E%3Cpath%20d%3D%22M14%2011v6%22/%3E%3C/svg%3E");
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dpw-main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .dpw-info-column {
        order: 2;
    }
    
    .dpw-form-column {
        order: 1;
    }
}

@media (max-width: 768px) {
    .dpw-calculator {
        padding: 15px;
        margin: 10px;
    }
    
    .dpw-calculator .dpw-plan-tabs {
        flex-direction: column;
        gap: 5px;
    }
    
    .dpw-calculator .dpw-plan-tab {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .dpw-calculator .dpw-plan-tab-active::before {
        top: 8px;
        right: 12px;
        font-size: 14px;
    }
    
    .dpw-option-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }
    
    .dpw-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 10px;
    }
    
    .dpw-capital-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .dpw-calculator .dpw-option-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .dpw-currency-switch {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .dpw-currency-options {
        width: 100%;
    }
    
    .dpw-currency-option {
        flex: 1;
        text-align: center;
    }
    
    .dpw-calculator .dpw-option-btn-active::before {
        font-size: 10px;
    }
    
    .dpw-calculator .dpw-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .dpw-calculator {
        padding: 10px;
        margin: 5px;
    }
    
    .dpw-calculator h2 {
        font-size: 20px;
    }
    
    .dpw-form-column,
    .dpw-info-column,
    .dpw-price-section {
        padding: 15px;
    }
    
    .dpw-price-amount {
        font-size: 28px;
    }
    
    .currency-symbol {
        font-size: 24px;
    }
    
    .dpw-calculator .dpw-option-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .dpw-capital-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .dpw-calculator .dpw-option-btn-active::before {
        font-size: 9px;
        top: 2px;
        right: 2px;
    }
    
    .dpw-calculator .dpw-plan-tab-active::before {
        top: 6px;
        right: 10px;
        font-size: 12px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .dpw-calculator {
        background: #1a202c;
        color: #e2e8f0;
    }
    
    .dpw-calculator .dpw-form-column,
    .dpw-calculator .dpw-info-column,
    .dpw-calculator .dpw-price-section {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .dpw-calculator .dpw-plan-tab {
        background: #2d3748 !important;
        color: #e2e8f0 !important;
    }
    
    .dpw-calculator .dpw-option-btn {
        background: #2d3748 !important;
        color: #e2e8f0 !important;
        border-color: #4a5568 !important;
    }
    
    .dpw-calculator .dpw-amount-input input {
        background: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }
}