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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Cairo', 'Tajawal', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    direction: rtl;
    text-align: right;
}

.app-container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* Header */
.header {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    text-align: center;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

/* Navigation */
.nav-bar {
    display: flex;
    background: white;
    border-bottom: 1px solid #eee;
    overflow-x: auto;
}

.nav-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 15px 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #666;
}

.nav-btn span {
    font-size: 18px;
}

.nav-btn.active {
    background: #f8f9fa;
    color: #ff6b6b;
    border-bottom: 3px solid #ff6b6b;
}

.nav-btn:hover {
    background: #f8f9fa;
}

/* Pages */
.page {
    display: none;
    padding: 20px;
    min-height: calc(100vh - 140px);
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 20px;
    color: #333;
}

/* Buttons */
.add-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

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

/* Search and Filter */
.search-filter {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.search-filter input,
.search-filter select {
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.search-filter input:focus,
.search-filter select:focus {
    outline: none;
    border-color: #ff6b6b;
}

/* Items */
.items-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.item-card {
    background: white;
    border: 2px solid #f0f0f0;
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.item-card.bought {
    border-color: #00d4aa;
    background: linear-gradient(135deg, #f0fff4, #e8f8f5);
}

.item-card.pending {
    border-color: #ffa726;
    background: linear-gradient(135deg, #fff8e1, #fff3c4);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.item-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.item-price {
    font-size: 18px;
    font-weight: bold;
    color: #ff6b6b;
}

.item-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.item-type {
    background: #f8f9fa;
    color: #666;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.item-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.item-status.bought {
    background: #00d4aa;
    color: white;
}

.item-status.pending {
    background: #ffa726;
    color: white;
}

.item-description {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-right: 3px solid #ff6b6b;
}

.item-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.action-btn {
    flex: 1;
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn {
    background: #007bff;
    color: white;
}

.toggle-btn:hover {
    background: #0056b3;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.delete-btn:hover {
    background: #c82333;
}

.edit-btn {
    background: #28a745;
    color: white;
}

.edit-btn:hover {
    background: #218838;
}

/* Reports */
.reports-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.report-card {
    background: white;
    border: 2px solid #f0f0f0;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.report-icon {
    font-size: 32px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    border-radius: 50%;
    color: white;
}

.report-content h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.report-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

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

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 0;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 20px;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    font-family: 'Cairo', 'Tajawal', Arial, sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff6b6b;
}

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

.form-actions {
    display: flex;
    gap: 10px;
    padding: 0 20px 20px;
}

.form-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn {
    background: #f8f9fa;
    color: #666;
}

.cancel-btn:hover {
    background: #e9ecef;
}

.save-btn {
    background: linear-gradient(135deg, #00d4aa, #01a085);
    color: white;
}

.save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 14px;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 480px) {
    .nav-btn {
        font-size: 11px;
        padding: 12px 5px;
    }
    
    .nav-btn span {
        font-size: 16px;
    }
    
    .page {
        padding: 15px;
    }
    
    .item-card {
        padding: 15px;
    }
    
    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .add-btn {
        width: 100%;
        text-align: center;
    }
}

/* Animation */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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