/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Heebo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    direction: rtl;
    text-align: right;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Login Section */
#login-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-card h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2rem;
    font-weight: 600;
}

.login-card p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* Main Section */
#main-section {
    background: #f8f9fa;
    min-height: 100vh;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
    text-align: right;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Heebo', sans-serif;
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-family: 'Heebo', sans-serif;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e1e5e9;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Heebo', sans-serif;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* Header */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header h1 {
    color: #333;
    font-size: 1.8rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: #666;
    font-weight: 500;
}

/* Navigation */
.nav-tabs {
    background: white;
    border-bottom: 1px solid #e1e5e9;
    padding: 0 20px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-family: 'Heebo', sans-serif;
    white-space: nowrap;
    min-width: 80px;
    text-align: center;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-btn:hover {
    color: #667eea;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    color: #666;
    font-size: 1rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.stat-card p {
    color: #333;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

/* Quick Actions */
.quick-actions {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
}

.quick-actions h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    color: #333;
    font-size: 1.8rem;
    font-weight: 600;
}

/* Photos Grid */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.photo-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease;
}

.photo-card:hover {
    transform: translateY(-5px);
}

.photo-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.photo-info {
    padding: 20px;
}

.photo-info h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 1.1rem;
    font-weight: 600;
}

.photo-info p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.photo-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 10px;
}

.photo-image {
    cursor: pointer;
}

.photo-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.photo-actions .btn-danger {
    padding: 8px 16px;
    font-size: 0.9rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.photo-actions .btn-danger:hover {
    background: #c82333;
}

.benefit-actions .btn-danger {
    padding: 8px 16px;
    font-size: 0.9rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.benefit-actions .btn-danger:hover {
    background: #c82333;
}

.task-actions .btn-danger {
    padding: 8px 16px;
    font-size: 0.9rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.task-actions .btn-danger:hover {
    background: #c82333;
}

/* Tasks List */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.task-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-right: 4px solid #667eea;
    transition: transform 0.2s ease;
}

.task-card:hover {
    transform: translateX(-5px);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.task-title {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.task-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.task-status.pending {
    background: #fff3cd;
    color: #856404;
}

.task-status.completed {
    background: #d4edda;
    color: #155724;
}

.task-description {
    color: #666;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.task-meta {
    display: flex;
    gap: 20px;
    font-size: 0.8rem;
    color: #999;
}

/* Benefits List */
.benefits-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.benefit-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-top: 4px solid #28a745;
    transition: transform 0.2s ease;
}

.benefit-card:hover {
    transform: translateY(-5px);
}

.benefit-title {
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.benefit-category {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.benefit-description {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.benefit-value {
    color: #28a745;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* Recent Content */
.recent-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.recent-content h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e1e5e9;
}

.modal-header h3 {
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #333;
}

.modal form {
    padding: 30px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .login-card {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .login-card h1 {
        font-size: 1.8rem;
    }
    
    .login-card p {
        font-size: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 0 15px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .nav-tabs {
        padding: 0 10px;
        gap: 5px;
    }
    
    .tab-btn {
        padding: 12px 15px;
        font-size: 14px;
        min-width: auto;
    }
    
    .main-content {
        padding: 20px 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-card h3 {
        font-size: 0.9rem;
    }
    
    .stat-card p {
        font-size: 2rem;
    }
    
    .quick-actions {
        padding: 20px;
        margin-bottom: 30px;
    }
    
    .quick-actions h2 {
        font-size: 1.3rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .action-buttons .btn-primary,
    .action-buttons .btn-secondary {
        width: 100%;
        padding: 15px;
        font-size: 16px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .photos-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .benefits-list {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .recent-content h2 {
        font-size: 1.3rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
        padding: 20px;
        max-height: 85vh;
    }
    
    .modal {
        align-items: flex-start;
        padding: 20px 0;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
        padding: 15px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .user-info span {
        font-size: 0.9rem;
    }
    
    .user-info .btn-secondary {
        width: 100%;
        padding: 12px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .login-card {
        padding: 25px 15px;
        margin: 15px;
    }
    
    .login-card h1 {
        font-size: 1.6rem;
    }
    
    .header-content {
        padding: 0 10px;
    }
    
    .header h1 {
        font-size: 1.3rem;
    }
    
    .nav-tabs {
        padding: 0 5px;
    }
    
    .tab-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .main-content {
        padding: 15px 10px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-card p {
        font-size: 1.8rem;
    }
    
    .quick-actions {
        padding: 15px;
    }
    
    .quick-actions h2 {
        font-size: 1.2rem;
    }
    
    .section-header h2 {
        font-size: 1.3rem;
    }
    
    .recent-content h2 {
        font-size: 1.2rem;
    }
    
    .modal-content {
        width: 98%;
        margin: 10px;
        padding: 15px;
        max-height: 90vh;
    }
    
    .modal {
        padding: 10px 0;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px;
        padding: 15px 12px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 15px 20px;
        font-size: 16px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .photo-card img {
        max-height: 200px;
        object-fit: cover;
    }
    
    .task-card,
    .benefit-card,
    .date-card {
        padding: 15px;
    }
    
    .task-header,
    .date-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .task-status,
    .date-category {
        align-self: flex-start;
    }
    
    .benefit-actions {
        justify-content: center;
        margin-top: 10px;
    }
    
    .benefit-actions .btn-danger {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
    
    .task-actions {
        justify-content: center;
        margin-top: 10px;
    }
    
    .task-actions .btn-danger {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 20px;
}

/* מודל ניהול משתמשים */
#users-modal .modal-content {
    max-width: 800px;
}

.modal-body {
    padding: 20px;
}

.users-section {
    margin-bottom: 30px;
}

.users-section h4 {
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #e1e5e9;
    padding-bottom: 10px;
}

.user-card {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-card.pending {
    border-left: 4px solid #ffc107;
    background: #fff3cd;
}

.user-card.approved {
    border-left: 4px solid #28a745;
    background: #d4edda;
}

.user-card.rejected {
    border-left: 4px solid #dc3545;
    background: #f8d7da;
}

.user-info h4 {
    margin: 0 0 5px 0;
    color: #333;
}

.user-info p {
    margin: 2px 0;
    font-size: 0.9rem;
    color: #666;
}

.user-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.user-actions button {
    padding: 6px 12px;
    font-size: 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* תמונות קטנות בדשבורד */
#recent-photos .photo-card {
    flex: 0 0 calc(20% - 16px);
    min-width: 120px;
    cursor: pointer;
}

#recent-photos .photo-card img {
    height: 120px;
}

/* מודל הצגת תמונה בגדול */
.photo-viewer-content {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
}

.photo-viewer-body {
    padding: 20px;
    text-align: center;
}

#photo-viewer-image {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 15px;
}

.photo-viewer-description {
    margin-bottom: 10px;
    color: #666;
    font-size: 1rem;
}

.photo-viewer-meta {
    font-size: 0.9rem;
    color: #999;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* תאריכים חשובים */
.dates-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.date-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.date-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.date-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.date-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.date-category {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.date-date {
    font-size: 1.1rem;
    font-weight: 600;
    color: #d32f2f;
    margin-bottom: 10px;
}

.date-time {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.date-description {
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

.date-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #999;
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
}

.date-actions {
    display: flex;
    gap: 10px;
}

.date-actions button {
    padding: 4px 8px;
    font-size: 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.date-actions .btn-edit {
    background: #e3f2fd;
    color: #1976d2;
}

.date-actions .btn-delete {
    background: #ffebee;
    color: #d32f2f;
}

.date-actions .btn-edit:hover {
    background: #bbdefb;
}

.date-actions .btn-delete:hover {
    background: #ffcdd2;
}

/* קטגוריות תאריכים */
.date-card[data-category="יום הולדת"] .date-category {
    background: #fff3e0;
    color: #f57c00;
}

.date-card[data-category="חתונה"] .date-category {
    background: #fce4ec;
    color: #c2185b;
}

.date-card[data-category="חג"] .date-category {
    background: #e8f5e8;
    color: #388e3c;
}

.date-card[data-category="אירוע משפחתי"] .date-category {
    background: #e1f5fe;
    color: #0277bd;
}

.date-card[data-category="אירוע עבודה"] .date-category {
    background: #f3e5f5;
    color: #7b1fa2;
}

.date-card[data-category="פגישה"] .date-category {
    background: #fff8e1;
    color: #fbc02d;
}

.date-card[data-category="אחר"] .date-category {
    background: #f5f5f5;
    color: #616161;
}
