/* Arabic RTL Styling for Accounting Application */
* {
    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: 20px;
    direction: rtl;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.2em;
}

/* Dashboard Styles */
.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.balance-card {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.balance-card h2 {
    margin-bottom: 15px;
    font-size: 1.3em;
}

#balance-amount {
    font-size: 2.5em;
    font-weight: bold;
}

.summary-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.summary-card {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.summary-card.income {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.summary-card.expense {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
}

.summary-card h3 {
    margin-bottom: 10px;
    font-size: 1.1em;
}

/* Actions */
.actions {
    text-align: center;
    margin-bottom: 30px;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    margin: 0 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
}

.btn-primary {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-edit {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.btn-edit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

/* Transactions Section */
.transactions-section {
    margin-top: 30px;
}

.transactions-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#transactions-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

#transactions-table th,
#transactions-table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid #ddd;
}

#transactions-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

#transactions-table tr:hover {
    background-color: #f5f5f5;
}

#transactions-table tr:last-child td {
    border-bottom: none;
}

.transaction-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.transaction-image:hover {
    transform: scale(1.1);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close {
    color: #aaa;
    float: left;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    left: 20px;
    top: 15px;
}

.close:hover {
    color: #000;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

input[type="text"],
input[type="number"],
input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Image Modal */
#modal-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2em;
    }
    
    #balance-amount {
        font-size: 2em;
    }
    
    #transactions-table th,
    #transactions-table td {
        padding: 10px;
        font-size: 0.9em;
    }
    
    .btn {
        width: 100%;
        margin: 10px 0;
    }
    
    .modal-content {
        margin: 20% auto;
        width: 95%;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8em;
    }
    
    #balance-amount {
        font-size: 1.8em;
    }
    
    #transactions-table {
        font-size: 0.8em;
    }
    
    .modal-content {
        padding: 15px;
    }
}

/* Arabic Font Support */
@font-face {
    font-family: 'Arabic';
    src: local('Segoe UI'), local('Tahoma');
    unicode-range: U+0600-06FF;
}

body {
    font-family: 'Arabic', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Balance colors */
.positive {
    color: #5265d3 !important;
}

.negative {
    color: #df645b !important;
}
/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}
