/**
 * ماشین‌حساب وزن لوله پلی‌اتیلن و سختی‌گیر رزینی - استایل‌ها
 * نسخه: 2.0.0
 */

/* ===========================================
   استایل‌های اصلی لوله پلی‌اتیلن - دست نخورده
   =========================================== */

.pe-calculator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 0;
    font-family: IRANSans;
    direction: rtl;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 100%;
    float: right;
    width: 100%;
    margin: 20px 0;
}

.pe-calculator-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 15px 25px;
    text-align: center;
    position: relative;
    float: right;
    width: 100%;
}

.pe-calculator-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    color: #fff !important;
    float: right;
    width: 100%;
}

.pe-calculator-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: #3498db;
    border-radius: 2px;
}

.pe-calculator-body {
    background: white;
    padding: 30px;
    float: right;
    width: 100%;
}

.pe-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    align-items: center;
}

.pe-form-group {
    width: 100%;
    min-width: 200px;
}

.pe-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 14px;
}

.pe-form-input, .pe-form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e6ed;
    border-radius: 15px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    direction: rtl;
    box-sizing: border-box;
}

.pe-form-input:focus, .pe-form-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transform: translateY(-1px);
}

.pe-calculate-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    margin: 15px auto;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    width: calc(50% - 20px);
    min-width: 140px;
    display: block;
}

.pe-calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
}

.pe-result-container {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-top: 25px;
    text-align: center;
    display: none;
    transform: translateY(20px);
    transition: all 0.5s ease;
    width: 100%;
    float: right;
}

.pe-result-container.show {
    display: block;
    transform: translateY(0);
}

.pe-result-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.pe-result-weight {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pe-result-price {
    font-size: 24px;
    margin: 10px 0;
    color: #f39c12 !important;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.pe-result-details {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 14px;
    line-height: 1.6;
}

.pe-error {
    background: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: center;
    float: right;
    width: 100%;
    font-weight: bold;
    box-sizing: border-box;
}

/* ===========================================
   استایل‌های سختی‌گیر رزینی - جدید
   =========================================== */

.resin-calculator {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border-radius: 15px;
    padding: 0;
    font-family: IRANSans, Tahoma, Arial, sans-serif;
    direction: rtl;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 100%;
    float: right;
    width: 100%;
    margin: 20px 0;
}

.resin-calculator-header {
    background: linear-gradient(135deg, #1e8449 0%, #239b56 100%);
    color: white;
    padding: 15px 25px;
    text-align: center;
    position: relative;
    float: right;
    width: 100%;
}

.resin-calculator-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    color: #fff !important;
    float: right;
    width: 100%;
}

.resin-calculator-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: #f1c40f;
    border-radius: 2px;
}

.resin-calculator-body {
    background: white;
    padding: 30px;
    float: right;
    width: 100%;
}

.resin-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    align-items: center;
}

.resin-form-group {
    width: 100%;
    min-width: 200px;
}

.resin-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 14px;
}

.resin-form-input, .resin-form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e6ed;
    border-radius: 15px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    direction: rtl;
    box-sizing: border-box;
}

.resin-form-input:focus, .resin-form-select:focus {
    outline: none;
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
    transform: translateY(-1px);
}

.resin-buttons-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

.resin-calculate-btn {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    min-width: 140px;
    flex: 1;
}

.resin-calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.resin-clear-btn {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
    min-width: 140px;
    flex: 1;
}

.resin-clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(149, 165, 166, 0.4);
    background: linear-gradient(135deg, #7f8c8d 0%, #95a5a6 100%);
}

.resin-result-container {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-top: 25px;
    text-align: center;
    display: none;
    transform: translateY(20px);
    transition: all 0.5s ease;
    width: 100%;
    float: right;
}

.resin-result-container.show {
    display: block;
    transform: translateY(0);
}

.resin-result-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.resin-result-capacity {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.resin-result-amount {
    font-size: 24px;
    font-weight: bold;
    margin: 10px 0;
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.resin-result-price {
    font-size: 28px;
    margin: 10px 0;
    color: #2c3e50 !important;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.resin-result-details {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 14px;
    line-height: 1.6;
    text-align: right;
}

.resin-error {
    background: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: center;
    float: right;
    width: 100%;
    font-weight: bold;
    box-sizing: border-box;
}

/* ===========================================
   استایل‌های مشترک و کدهای اصلی
   =========================================== */

.validation-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
}

/* انیمیشن‌های اصلی - دست نخورده */
.pe-calculator-header h2, .resin-calculator-header h2 {
    animation: fadeInDown 0.6s ease-out;
}

.pe-form-group, .resin-form-group {
    animation: fadeInUp 0.6s ease-out;
}

.pe-calculate-btn {
    animation: pulse 2s infinite;
}

.resin-calculate-btn {
    animation: pulseresin 2s infinite;
}

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

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

@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(52, 152, 219, 0.5);
    }
    100% {
        box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    }
}

@keyframes pulseresin {
    0% {
        box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(39, 174, 96, 0.5);
    }
    100% {
        box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    }
}

/* ===========================================
   Responsive Design - کدهای اصلی دست نخورده
   =========================================== */

@media (max-width: 768px) {
    .pe-form-row, .resin-form-row {
        flex-direction: column;
    }
    
    .pe-form-group, .resin-form-group {
        min-width: 100%;
    }
    
    .pe-calculator-body, .resin-calculator-body {
        padding: 20px;
    }
    
    .pe-calculator-header h2, .resin-calculator-header h2 {
        font-size: 20px;
    }
    
    .pe-result-weight, .resin-result-capacity {
        font-size: 28px;
    }
    
    .pe-result-price, .resin-result-price {
        font-size: 20px;
    }
    
    .resin-result-amount {
        font-size: 20px;
    }
    
    .pe-calculator-header, .resin-calculator-header {
        padding: 20px;
    }
    
    .pe-calculate-btn, .resin-calculate-btn, .resin-clear-btn {
        width: 100%;
        margin: 10px 0;
    }
    
    .resin-buttons-container {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .pe-calculator-body, .resin-calculator-body {
        padding: 15px;
    }
    
    .pe-form-input, .pe-form-select,
    .resin-form-input, .resin-form-select {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .pe-calculate-btn, .resin-calculate-btn, .resin-clear-btn {
        padding: 12px 30px;
        font-size: 14px;
    }
    
    .pe-calculator-header h2, .resin-calculator-header h2 {
        font-size: 18px;
    }
    
    .pe-result-weight, .resin-result-capacity {
        font-size: 24px;
    }
    
    .pe-result-price, .resin-result-price {
        font-size: 18px;
    }
    
    .resin-result-amount {
        font-size: 18px;
    }
}

/* ===========================================
   سازگاری با تم‌های مختلف وردپرس - کدهای اصلی
   =========================================== */

.pe-calculator *, .resin-calculator * {
    box-sizing: border-box;
}

.pe-calculator h2, .resin-calculator h2 {
    margin: 0 !important;
    padding: 0 !important;
}

/* حالت تیره (Dark Mode) - کدهای اصلی */
@media (prefers-color-scheme: dark) {
    .pe-calculator-body, .resin-calculator-body {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .pe-form-input, .pe-form-select,
    .resin-form-input, .resin-form-select {
        background: #34495e;
        color: #ecf0f1;
        border-color: #4a6741;
    }
    
    .pe-form-label, .resin-form-label {
        color: #ecf0f1;
    }
}

/* بهبود دسترسی - کدهای اصلی */
.pe-form-input:focus, .pe-form-select:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.resin-form-input:focus, .resin-form-select:focus {
    outline: 2px solid #27ae60;
    outline-offset: 2px;
}

.pe-calculate-btn:focus {
    outline: 2px solid #2980b9;
    outline-offset: 2px;
}

.resin-calculate-btn:focus, .resin-clear-btn:focus {
    outline: 2px solid #1e8449;
    outline-offset: 2px;
}

/* حالت چاپ - کدهای اصلی */
@media print {
    .pe-calculator, .resin-calculator {
        box-shadow: none;
        background: white !important;
    }
    
    .pe-calculator-header, .resin-calculator-header {
        background: #333 !important;
    }
    
    .pe-result-container, .resin-result-container {
        background: #333 !important;
    }
    
    .pe-calculate-btn, .resin-calculate-btn, .resin-clear-btn {
        display: none;
    }
}

.pe-clear-btn, .resin-clear-btn {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
    min-width: 140px;
    flex: 1;
}

.pe-clear-btn:hover, .resin-clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(149, 165, 166, 0.4);
    background: linear-gradient(135deg, #7f8c8d 0%, #95a5a6 100%);
}

/* ===========================================
   نمایش نتایج
   =========================================== */

.pe-result-container, .resin-result-container {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-top: 25px;
    text-align: center;
    display: none;
    transform: translateY(20px);
    transition: all 0.5s ease;
    width: 100%;
}

.resin-result-container {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.pe-result-container.show, .resin-result-container.show {
    display: block;
    transform: translateY(0);
}

.pe-result-title, .resin-result-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.pe-result-weight, .resin-result-capacity {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.resin-result-amount {
    font-size: 24px;
    font-weight: bold;
    margin: 10px 0;
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.pe-result-price, .resin-result-price {
    font-size: 24px;
    margin: 10px 0;
    color: #f39c12 !important;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.resin-result-price {
    color: #2c3e50 !important;
    font-size: 28px;
}

.pe-result-details, .resin-result-details {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 14px;
    line-height: 1.6;
    text-align: right;
}

/* ===========================================
   پیام‌های خطا و هشدار
   =========================================== */

.pe-error, .resin-error {
    background: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: center;
    width: 100%;
    font-weight: bold;
    box-sizing: border-box;
}

.validation-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
}

/* ===========================================
   انیمیشن‌ها
   =========================================== */

.pe-calculator-header h2, .resin-calculator-header h2 {
    animation: fadeInDown 0.6s ease-out;
}

.pe-form-group, .resin-form-group {
    animation: fadeInUp 0.6s ease-out;
}

.pe-calculate-btn, .resin-calculate-btn {
    animation: pulse 2s infinite;
}

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

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

@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(52, 152, 219, 0.5);
    }
    100% {
        box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    }
}

/* انیمیشن pulse برای دکمه سختی‌گیر */
.resin-calculate-btn {
    animation: pulseresin 2s infinite;
}

@keyframes pulseresin {
    0% {
        box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(39, 174, 96, 0.5);
    }
    100% {
        box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    }
}

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

@media (max-width: 768px) {
    .pe-form-row, .resin-form-row {
        flex-direction: column;
    }
    
    .pe-form-group, .resin-form-group {
        min-width: 100%;
    }
    
    .pe-calculator-body, .resin-calculator-body {
        padding: 20px;
    }
    
    .pe-calculator-header h2, .resin-calculator-header h2 {
        font-size: 20px;
    }
    
    .pe-result-weight, .resin-result-capacity {
        font-size: 28px;
    }
    
    .pe-result-price, .resin-result-price {
        font-size: 20px;
    }
    
    .resin-result-amount {
        font-size: 20px;
    }
    
    .pe-calculator-header, .resin-calculator-header {
        padding: 20px;
    }
    
    .pe-buttons-container, .resin-buttons-container {
        flex-direction: column;
    }
    
    .pe-calculate-btn, .pe-clear-btn,
    .resin-calculate-btn, .resin-clear-btn {
        width: 100%;
        margin: 5px 0;
    }
}

@media (max-width: 480px) {
    .pe-calculator-body, .resin-calculator-body {
        padding: 15px;
    }
    
    .pe-form-input, .pe-form-select,
    .resin-form-input, .resin-form-select {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .pe-calculate-btn, .pe-clear-btn,
    .resin-calculate-btn, .resin-clear-btn {
        padding: 12px 30px;
        font-size: 14px;
    }
    
    .pe-calculator-header h2, .resin-calculator-header h2 {
        font-size: 18px;
    }
    
    .pe-result-weight, .resin-result-capacity {
        font-size: 24px;
    }
    
    .pe-result-price, .resin-result-price {
        font-size: 18px;
    }
    
    .resin-result-amount {
        font-size: 18px;
    }
}

/* ===========================================
   سازگاری با تم‌های مختلف وردپرس
   =========================================== */

.pe-calculator *, .resin-calculator * {
    box-sizing: border-box;
}

.pe-calculator h2, .resin-calculator h2 {
    margin: 0 !important;
    padding: 0 !important;
}

/* ===========================================
   حالت تیره (Dark Mode)
   =========================================== */

@media (prefers-color-scheme: dark) {
    .pe-calculator-body, .resin-calculator-body {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .pe-form-input, .pe-form-select,
    .resin-form-input, .resin-form-select {
        background: #34495e;
        color: #ecf0f1;
        border-color: #4a6741;
    }
    
    .pe-form-label, .resin-form-label {
        color: #ecf0f1;
    }
}

/* ===========================================
   بهبود دسترسی
   =========================================== */

.pe-form-input:focus, .pe-form-select:focus,
.resin-form-input:focus, .resin-form-select:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.resin-form-input:focus, .resin-form-select:focus {
    outline-color: #27ae60;
}

.pe-calculate-btn:focus, .pe-clear-btn:focus {
    outline: 2px solid #2980b9;
    outline-offset: 2px;
}

.resin-calculate-btn:focus, .resin-clear-btn:focus {
    outline: 2px solid #1e8449;
    outline-offset: 2px;
}

/* ===========================================
   حالت چاپ
   =========================================== */

@media print {
    .pe-calculator, .resin-calculator {
        box-shadow: none;
        background: white !important;
    }
    
    .pe-calculator-header, .resin-calculator-header {
        background: #333 !important;
    }
    
    .pe-result-container, .resin-result-container {
        background: #333 !important;
    }
    
    .pe-calculate-btn, .pe-clear-btn,
    .resin-calculate-btn, .resin-clear-btn {
        display: none;
    }
}

/* ===========================================
   استایل‌های اضافی برای بهبود ظاهر
   =========================================== */

/* تأکید بر تفاوت دو ماشین‌حساب */
.pe-calculator {
    border-left: 5px solid #3498db;
}

.resin-calculator {
    border-left: 5px solid #27ae60;
}

/* شدت پس‌زمینه برای نتایج */
.pe-result-container {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.resin-result-container {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* سایه بهتر برای input ها */
.pe-form-input, .pe-form-select,
.resin-form-input, .resin-form-select {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* نمایش بهتر برای placeholder ها */
.pe-form-input::placeholder,
.resin-form-input::placeholder {
    color: #95a5a6;
    font-style: italic;
}

/* جدا کننده بصری بین بخش‌ها */
.pe-calculator-container, .resin-calculator-container {
    margin: 40px auto;
    position: relative;
}

/* نشانگر بارگذاری برای دکمه‌ها */
.pe-calculate-btn:active, .resin-calculate-btn:active {
    transform: scale(0.98);
}