/* =================================================================================
// ملف style.css المحدث - تصميم مشابه للتطبيق الأصلي مع أنماط جديدة
// ================================================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    direction: rtl; /* لضمان الاتجاه من اليمين لليسار */
    text-align: right;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    margin-top: 50px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 5px;
}

h2 {
    color: #555;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 20px;
    margin-bottom: 15px;
    text-align: center;
}

p {
    color: #666;
    text-align: center;
    margin-bottom: 20px;
}

.logo-placeholder {
    text-align: center;
    margin-bottom: 15px;
}

.logo-placeholder img {
    max-width: 120px; /* زيادة حجم الشعار قليلاً */
    height: auto;
    margin-bottom: 10px;
}

.logo-placeholder h1 {
    margin-top: 0;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #444;
}

.input-group input[type="text"],
.input-group input[type="password"],
.input-group input[type="tel"],
.input-group input[type="number"],
.input-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    text-align: right;
}

.input-group textarea {
    resize: vertical;
    min-height: 80px;
}

button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
}

button:hover {
    opacity: 0.9;
}

.login-button {
    background: #4CAF50;
}

.data-management button {
    margin-top: 5px;
}

.export-button {
    background: #007bff; /* أزرق */
}

.import-button {
    background: #ffc107; /* أصفر */
}

.logout-button {
    background: #f44336;
    margin-top: 20px;
}

.add-customer-button {
    background: #00bcd4;
}

.dashboard {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    text-align: center;
}

.stat-box {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    width: 48%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-box h3 {
    color: #777;
    font-size: 14px;
    margin-bottom: 5px;
}

.stat-box p {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.message-box {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
    display: none;
}

.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.debtor-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.debtor-name {
    font-weight: bold;
    font-size: 18px;
    color: #333;
}

.debtor-debt {
    font-size: 16px;
    color: #f44336;
    margin: 5px 0;
}

.debtor-actions button {
    width: auto;
    padding: 8px 12px;
    margin-left: 5px;
    font-size: 14px;
}

.debtor-actions .info { background: #2196F3; }
.debtor-actions .success { background: #4CAF50; }
.debtor-actions .whatsapp { background: #25D366; }
.debtor-actions .danger { background: #f44336; }

/* أنماط النافذة المنبثقة (Modal) */
.modal {
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    display: none;
}

.modal.active {
    display: block;
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 10px;
    position: relative;
}

.close-button {
    color: #aaa;
    float: left;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #000;
    text-decoration: none;
}

.details-section h3 {
    margin-top: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    color: #333;
}

.details-section p {
    text-align: right;
    margin: 5px 0;
}

/* أنماط سجل المعاملات */
#transactionHistoryList {
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dotted #ccc;
    font-size: 14px;
}

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

.transaction-type {
    font-weight: bold;
    width: 15%;
}

.transaction-amount {
    font-weight: bold;
    width: 20%;
    text-align: center;
}

.debt-plus {
    color: #4CAF50; /* لون أخضر للدين المضاف */
}

.debt-minus {
    color: #f44336; /* لون أحمر للتسديد */
}

.transaction-date {
    color: #777;
    width: 35%;
    text-align: center;
}

.transaction-note {
    color: #555;
    width: 30%;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.details-actions button {
    margin-top: 15px;
}
