/* NovaFlow Invoice Builder Styles */
@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir-Regular.ttf') format('truetype');
    font-display: swap;
}

.novaflow-container {
    font-family: 'Vazir', Tahoma, sans-serif;
    direction: rtl;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    max-width: 900px;
    margin: 30px auto;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.novaflow-title {
    font-size: 22px; font-weight: bold; margin-bottom: 20px; text-align: center; color: #333;
}
.novaflow-section {
    margin-bottom: 20px; padding: 15px; border: 1px solid #ddd; border-radius: 8px;
}
.novaflow-section h3 {
    margin-top: 0; color: #0073e6; font-size: 18px; border-bottom: 1px solid #eee; padding-bottom: 8px;
}
.novaflow-input {
    width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 8px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box; transition: border-color 0.3s ease;
}
.novaflow-input:focus { border-color: #0073e6; outline: none; box-shadow: 0 0 0 2px rgba(0, 115, 230, 0.2); }
.novaflow-input.error { border-color: #dc3545; }

.novaflow-table {
    width: 100%; border-collapse: collapse; margin: 15px 0; background: #fff;
}
.novaflow-table th, .novaflow-table td {
    border: 1px solid #ddd; padding: 12px; text-align: center;
}
.novaflow-table th {
    background: #f5f5f5; font-weight: bold; color: #222;
}
.novaflow-btn {
    padding: 10px 18px; border-radius: 8px; border: none; font-size: 14px; font-weight: bold; cursor: pointer; transition: all 0.2s ease; background: #0073e6; color: #fff; margin: 10px 5px 0 0; display: inline-flex; align-items: center; gap: 5px;
}
.novaflow-btn:hover { background: #0056b3; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.novaflow-btn.novaflow-pdf { background: #28a745; width: 100%; justify-content: center; padding: 15px; font-size: 16px; }
.novaflow-btn.novaflow-pdf:hover { background: #218838; }
.novaflow-btn.novaflow-remove { background: #dc3545; padding: 5px 10px; font-size: 12px; }

.novaflow-sum { font-weight: bold; margin: 15px 0; font-size: 16px; color: #333; display: flex; justify-content: space-between; align-items: center; }
.novaflow-sum span { color: #0073e6; font-size: 18px; }

.novaflow-sig-canvas { 
    border: 1px solid #ccc; 
    border-radius: 5px; 
    cursor: crosshair; 
    width: 200px; 
    height: 100px; 
    background: #fff; 
    /* افکت انیمیشن برای بزرگنمایی نرم */
    transition: width 0.3s ease-in-out, height 0.3s ease-in-out; 
}

/* بزرگ شدن کانواس هنگام hover شدن موس */
.novaflow-sig-canvas:hover { 
    width: 400px; 
    height: 200px; 
}
.novaflow-clear-sig { margin-right: 10px; padding: 5px 10px; background: #dc3545; color: #fff; border: none; border-radius: 5px; cursor: pointer; font-size: 12px; }
.novaflow-clear-sig:hover { background: #c82333; }

/* ================= واکنش‌گرایی کامل برای موبایل ================= */
@media (max-width: 768px) {
    .novaflow-container { padding: 15px; margin: 10px; border-radius: 8px; }
    .novaflow-title { font-size: 20px; margin-bottom: 15px; }
    .novaflow-section { padding: 10px; margin-bottom: 15px; }
    .novaflow-section h3 { font-size: 16px; }

    /* بزرگ نگه داشتن کانواس در موبایل و لغو افکت هاور */
    .novaflow-sig-canvas {
        width: 100% !important;
        max-width: 400px;
        height: 150px !important;
    }
    .novaflow-sig-canvas:hover {
        width: 100% !important;
        height: 150px !important;
    }
    
    /* جلوگیری از زوم صفحه در آیفون هنگام تایپ */
    .novaflow-input { font-size: 16px !important; padding: 12px; margin-bottom: 8px; }
    
    /* تبدیل جدول به حالت کارت در موبایل */
    .novaflow-table thead { display: none; }
    .novaflow-table, .novaflow-table tbody, .novaflow-table tr, .novaflow-table td { display: block; width: 100%; }
    .novaflow-table tr { border: 1px solid #ccc; border-radius: 8px; margin-bottom: 15px; padding: 10px; }
    .novaflow-table td { border: none; border-bottom: 1px solid #eee; position: relative; padding-left: 40%; text-align: right; }
    .novaflow-table td:before { position: absolute; top: 12px; right: 12px; width: 35%; padding-right: 10px; font-weight: bold; color: #0073e6; white-space: nowrap; }
    .novaflow-table td:nth-of-type(1):before { content: "نام کالا"; } .novaflow-table td:nth-of-type(2):before { content: "شرح"; }
    .novaflow-table td:nth-of-type(3):before { content: "تعداد"; } .novaflow-table td:nth-of-type(4):before { content: "قیمت"; }
    .novaflow-table td:nth-of-type(5):before { content: "جمع"; } .novaflow-table td:nth-of-type(6):before { content: "حذف"; text-align: right; }

    .novaflow-btn { width: 100%; margin: 5px 0; justify-content: center; }
    .novaflow-sum { flex-direction: column; align-items: flex-start; gap: 5px; }
}

/* Animation for notifications */
@keyframes slideIn { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.novaflow-notification { position: fixed; top: 20px; right: 20px; padding: 15px 20px; border-radius: 5px; color: white; font-weight: bold; z-index: 10000; animation: slideIn 0.3s ease; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.novaflow-notification.success { background-color: #28a745; } .novaflow-notification.error { background-color: #dc3545; } .novaflow-notification.info { background-color: #17a2b8; }