/* ===============================================
   Global Styles & Reset
   =============================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #1976d2;
    --primary-dark: #0d47a1;
    --primary-light: #42a5f5;
    --secondary-blue: #64b5f6;
    --accent-blue: #2196f3;
    --white: #ffffff;
    --light-gray: #f5f7fa;
    --border-gray: #e0e0e0;
    --text-dark: #212121;
    --text-gray: #666666;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Heebo', sans-serif;
    background: var(--light-gray);
    color: var(--text-dark);
    line-height: 1.6;
    direction: rtl;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===============================================
   Header
   =============================================== */
.header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 20px 0;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.header h1 i {
    margin-left: 12px;
    color: var(--secondary-blue);
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* ===============================================
   Navigation
   =============================================== */
.nav {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    color: var(--text-gray);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary-blue);
    background: var(--light-gray);
}

.nav-link.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
    background: var(--light-gray);
}

.nav-link i {
    font-size: 18px;
}

/* ===============================================
   Main Content
   =============================================== */
.main {
    padding: 30px 0;
    min-height: calc(100vh - 200px);
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.section-title {
    font-size: 28px;
    color: var(--text-dark);
    margin-bottom: 25px;
    font-weight: 600;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

/* ===============================================
   Buttons
   =============================================== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-secondary:hover {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #c62828;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    padding: 10px 12px;
    border-radius: 50%;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===============================================
   Cards
   =============================================== */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-gray);
    background: linear-gradient(to bottom, var(--white), var(--light-gray));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-blue);
}

.card-body {
    padding: 25px;
}

/* ===============================================
   Stats Cards (Dashboard)
   =============================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-blue);
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--text-gray);
    margin-top: 5px;
}

/* ===============================================
   Dashboard Layout
   =============================================== */
.dashboard-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-col {
    min-width: 0;
}

/* ===============================================
   Tasks
   =============================================== */
.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.task-card {
    background: var(--white);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    border-right: 4px solid var(--primary-blue);
    transition: all 0.3s ease;
}

.task-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.task-card.priority-גבוהה {
    border-right-color: var(--danger);
}

.task-card.priority-בינונית {
    border-right-color: var(--warning);
}

.task-card.priority-נמוכה {
    border-right-color: var(--success);
}

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

.task-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    flex: 1;
}

.task-actions {
    display: flex;
    gap: 8px;
}

.task-actions button {
    background: none;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.task-actions button:hover {
    background: var(--light-gray);
    color: var(--primary-blue);
}

.task-description {
    color: var(--text-gray);
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.task-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.task-badge.status {
    background: var(--primary-light);
    color: var(--white);
}

.task-badge.status-תכנון {
    background: #90caf9;
}

.task-badge.status-בתהליך {
    background: #ffa726;
}

.task-badge.status-ממתין {
    background: #ffeb3b;
    color: var(--text-dark);
}

.task-badge.status-הושלם {
    background: #66bb6a;
}

.task-badge.category {
    background: var(--light-gray);
    color: var(--text-dark);
}

.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-gray);
    font-size: 13px;
    color: var(--text-gray);
}

/* ===============================================
   Contacts
   =============================================== */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.contact-card {
    background: var(--white);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

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

.contact-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.contact-role {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-light);
    color: var(--white);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.contact-rating {
    color: #ffc107;
    font-size: 16px;
}

.contact-details {
    margin: 15px 0;
}

.contact-detail {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: var(--text-gray);
    font-size: 14px;
}

.contact-detail i {
    color: var(--primary-blue);
    width: 20px;
}

.contact-actions {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--border-gray);
}

.contact-actions button {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.contact-actions .btn-call {
    background: var(--success);
    color: var(--white);
}

.contact-actions .btn-call:hover {
    background: #388e3c;
}

.contact-actions .btn-edit {
    background: var(--light-gray);
    color: var(--text-dark);
}

.contact-actions .btn-edit:hover {
    background: var(--primary-blue);
    color: var(--white);
}

/* ===============================================
   Costs & Budget
   =============================================== */
.budget-overview {
    display: grid;
    gap: 15px;
}

.budget-item {
    background: var(--light-gray);
    padding: 15px 20px;
    border-radius: 8px;
    border-right: 4px solid var(--primary-blue);
}

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

.budget-category {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 16px;
}

.budget-amounts {
    display: flex;
    gap: 20px;
    font-size: 14px;
    margin-bottom: 10px;
}

.budget-planned,
.budget-spent {
    display: flex;
    flex-direction: column;
}

.budget-label {
    color: var(--text-gray);
    font-size: 12px;
}

.budget-value {
    font-weight: 600;
    color: var(--text-dark);
}

.budget-progress {
    height: 8px;
    background: var(--border-gray);
    border-radius: 10px;
    overflow: hidden;
}

.budget-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--secondary-blue));
    border-radius: 10px;
    transition: width 0.3s ease;
}

.budget-progress-bar.over-budget {
    background: linear-gradient(90deg, var(--danger), #ff5722);
}

.costs-table {
    width: 100%;
    border-collapse: collapse;
}

.costs-table th,
.costs-table td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid var(--border-gray);
}

.costs-table th {
    background: var(--light-gray);
    font-weight: 600;
    color: var(--text-dark);
}

.costs-table tbody tr:hover {
    background: var(--light-gray);
}

.payment-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.payment-status.שולם {
    background: #c8e6c9;
    color: #2e7d32;
}

.payment-status.ממתין {
    background: #fff9c4;
    color: #f57f17;
}

/* ===============================================
   Schedule
   =============================================== */
.schedule-item {
    background: var(--white);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    border-right: 4px solid var(--primary-blue);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.schedule-item:hover {
    box-shadow: var(--shadow);
    transform: translateX(-3px);
}

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

.schedule-title {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 16px;
}

.schedule-category {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: var(--primary-light);
    color: var(--white);
}

.schedule-details {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-gray);
}

.schedule-detail {
    display: flex;
    align-items: center;
    gap: 6px;
}

.schedule-detail i {
    color: var(--primary-blue);
}

/* ===============================================
   Planning Tabs
   =============================================== */
.planning-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 24px;
    background: var(--white);
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-gray);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.tab-btn.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ===============================================
   Media Gallery
   =============================================== */
.media-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 8px 20px;
    background: var(--white);
    border: 2px solid var(--border-gray);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-gray);
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.filter-btn.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: var(--white);
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.media-item {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
}

.media-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.media-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--light-gray);
}

.media-info {
    padding: 15px;
}

.media-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.media-description {
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 10px;
}

.media-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.media-tag {
    padding: 3px 10px;
    background: var(--light-gray);
    border-radius: 12px;
    font-size: 11px;
    color: var(--text-gray);
}

/* ===============================================
   Filter Bar
   =============================================== */
.filter-bar {
    margin-bottom: 20px;
}

.filter-bar select {
    padding: 10px 15px;
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    font-size: 14px;
    background: var(--white);
    cursor: pointer;
}

/* ===============================================
   Modal
   =============================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

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

.modal-content {
    background: var(--white);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

.modal-large {
    max-width: 900px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-gray);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--light-gray);
    color: var(--text-dark);
}

.modal-body {
    padding: 25px;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border-gray);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===============================================
   Forms
   =============================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Heebo', sans-serif;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-gray);
}

/* ===============================================
   Image Selector (Video Modal)
   =============================================== */
.images-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: var(--light-gray);
    border-radius: 8px;
}

.selector-image {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.selector-image:hover {
    border-color: var(--primary-light);
}

.selector-image.selected {
    border-color: var(--primary-blue);
}

.selector-image img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.selector-image .select-indicator {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 24px;
    height: 24px;
    background: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s;
}

.selector-image.selected .select-indicator {
    opacity: 1;
}

/* ===============================================
   Loading & Empty States
   =============================================== */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-gray);
    font-size: 16px;
}

.loading::before {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid var(--border-gray);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-gray);
}

.empty-state i {
    font-size: 64px;
    color: var(--border-gray);
    margin-bottom: 20px;
}

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

/* ===============================================
   Responsive
   =============================================== */
@media (max-width: 768px) {
    .header h1 {
        font-size: 20px;
    }
    
    .nav-list {
        padding: 0;
    }
    
    .nav-link {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-row {
        grid-template-columns: 1fr;
    }
    
    .tasks-grid,
    .contacts-grid,
    .media-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10px;
        max-width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ===============================================
   Utility Classes
   =============================================== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}
