/**
 * style.css - עיצוב מקצועי RTL למערכת רישום עסקים
 * Professional RTL Styling for Business Registry System
 */

/* ===== גופנים ומשתנים ===== */
@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;600;700&display=swap');

:root {
    /* צבעי העמותה — זית וזהב מהלוגו */
    --primary-blue: #5f6848;
    --primary-blue-dark: #3e4530;
    --primary-blue-light: #7a8460;
    --gold: #e08a2c;
    --gold-dark: #c4721a;
    --cream: #f7f4ee;
    --ink: #1c1c1c;
    --success-green: #16a34a;
    --success-green-dark: #15803d;
    --danger-red: #dc2626;
    --danger-red-dark: #b91c1c;
    --warning-yellow: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* מרווחים */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* צללים */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* רדיוסים */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* מעברים */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ===== איפוס ובסיס ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    direction: rtl;
    text-align: right;
    background-color: var(--cream);
    color: var(--ink);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--gray-900);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-md);
    color: var(--gray-700);
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-blue-dark);
}

/* ===== כפתורים ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: white;
}

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

.btn-success {
    background: linear-gradient(135deg, var(--success-green) 0%, var(--success-green-dark) 100%);
    color: white;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-red) 0%, var(--danger-red-dark) 100%);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* ===== טפסים ===== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--gray-700);
}

.form-label.required::after {
    content: ' *';
    color: var(--danger-red);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: white;
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(95, 104, 72, 0.18);
}

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

.form-error {
    color: var(--danger-red);
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
}

.form-help {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
}

/* ===== כרטיסים ===== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    transition: all var(--transition-normal);
}

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

.card-header {
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0;
}

.card-body {
    padding: var(--spacing-md) 0;
}

.card-footer {
    border-top: 2px solid var(--gray-200);
    padding-top: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

/* ===== Grid ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--spacing-lg);
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    margin: 0 calc(-1 * var(--spacing-lg) / 2);
}

.col-1 { flex: 0 0 calc(8.333% - var(--spacing-lg)); }
.col-2 { flex: 0 0 calc(16.666% - var(--spacing-lg)); }
.col-3 { flex: 0 0 calc(25% - var(--spacing-lg)); }
.col-4 { flex: 0 0 calc(33.333% - var(--spacing-lg)); }
.col-5 { flex: 0 0 calc(41.666% - var(--spacing-lg)); }
.col-6 { flex: 0 0 calc(50% - var(--spacing-lg)); }
.col-7 { flex: 0 0 calc(58.333% - var(--spacing-lg)); }
.col-8 { flex: 0 0 calc(66.666% - var(--spacing-lg)); }
.col-9 { flex: 0 0 calc(75% - var(--spacing-lg)); }
.col-10 { flex: 0 0 calc(83.333% - var(--spacing-lg)); }
.col-11 { flex: 0 0 calc(91.666% - var(--spacing-lg)); }
.col-12 { flex: 0 0 calc(100% - var(--spacing-lg)); }

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }

.p-1 { padding: var(--spacing-sm); }
.p-2 { padding: var(--spacing-md); }
.p-3 { padding: var(--spacing-lg); }
.p-4 { padding: var(--spacing-xl); }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }

/* ===== הודעות (Toast/Alert) ===== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 300px;
    max-width: 500px;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toast-success {
    background: var(--success-green);
    color: white;
}

.toast-error {
    background: var(--danger-red);
    color: white;
}

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

.toast-warning {
    background: var(--warning-yellow);
    color: white;
}

/* ===== Loading Spinner ===== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid white;
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .card {
        padding: var(--spacing-lg);
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .row {
        gap: var(--spacing-md);
    }
    
    [class*="col-"] {
        flex: 0 0 100%;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.2rem; }
}

/* ===== מיתוג העמותה ===== */
.brand-logo,
.footer-logo,
.hero-logo,
.login-logo {
    object-fit: cover;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--gold);
}

.site-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: #fff;
    padding: 0.9rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    text-decoration: none;
    min-width: 0;
}

.brand:hover { color: #fff; }

.brand-logo {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-org {
    font-size: 0.75rem;
    opacity: 0.9;
    line-height: 1.3;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.nav-menu {
    background: #fff;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    border-radius: 0.75rem;
    overflow: hidden;
}

.nav-menu-inner {
    display: flex;
}

.nav-item {
    flex: 1;
    padding: 0.9rem 0.5rem;
    text-align: center;
    background: #fff;
    color: var(--gray-700);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.95rem;
    font-weight: 500;
    border-inline-start: 1px solid var(--gray-200);
    min-width: 0;
}

.nav-item:first-child { border-inline-start: none; }

.nav-item:hover {
    background: var(--cream);
    color: var(--primary-blue-dark);
}

.nav-item.active {
    background: var(--primary-blue);
    color: #fff;
}

.nav-item i { font-size: 1.25rem; }

.page-intro {
    margin-bottom: 1.25rem;
}

.page-intro h1 {
    margin-bottom: 0.25rem;
}

.page-intro p {
    margin: 0;
    color: var(--gray-600);
}

.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 1rem 2rem;
    text-align: center;
    color: var(--gray-600);
}

.site-footer p {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
}

.footer-logo {
    width: 56px;
    height: 56px;
}

.stat-card,
.stat-box {
    border-top: 3px solid var(--gold);
}

.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 80% 0%, rgba(224, 138, 44, 0.28), transparent 42%),
        linear-gradient(160deg, var(--primary-blue-dark) 0%, var(--primary-blue) 55%, #8a6a32 100%);
    color: #fff;
    text-align: center;
    padding: 2rem 1rem 3rem;
}

.hero-content { max-width: 760px; }

.hero-logo {
    width: 148px;
    height: 148px;
    margin-bottom: 1.25rem;
}

.hero-org {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 0.35rem;
}

.hero h1 {
    font-size: 2.6rem;
    margin-bottom: 0.75rem;
    color: #fff;
}

.hero p {
    font-size: 1.15rem;
    margin-bottom: 1.75rem;
    color: rgba(255, 255, 255, 0.9);
}

.hero-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-btn {
    padding: 1rem 1.75rem;
    font-size: 1.05rem;
    border-radius: 0.75rem;
    font-weight: 600;
    min-height: 48px;
}

.hero-btn-primary { background: #fff; color: var(--primary-blue-dark); }
.hero-btn-primary:hover { color: var(--primary-blue-dark); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.hero-btn-outline { background: transparent; color: #fff; border: 2px solid #fff; }
.hero-btn-outline:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.features { padding: 3rem 1rem 1rem; background: var(--cream); }
.features h2 { text-align: center; margin-bottom: 1.5rem; }
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    max-width: 1000px;
    margin: 0 auto;
}
.feature-card {
    text-align: center;
    padding: 1.5rem 1.25rem;
    border-radius: 1rem;
    background: #fff;
    border-top: 3px solid var(--gold);
    box-shadow: var(--shadow-sm);
}
.feature-icon { font-size: 2rem; color: var(--primary-blue); margin-bottom: 0.75rem; }
.feature-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.35rem; }
.feature-desc { color: var(--gray-600); margin: 0; }

.login-screen {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    background:
        radial-gradient(circle at 20% 0%, rgba(224, 138, 44, 0.25), transparent 40%),
        linear-gradient(160deg, var(--primary-blue-dark), var(--primary-blue));
}
.login-card {
    background: #fff;
    padding: 2rem 1.5rem;
    border-radius: 1rem;
    text-align: center;
    width: min(420px, 100%);
    box-shadow: var(--shadow-xl);
}
.login-logo { width: 112px; height: 112px; margin-bottom: 1rem; }
.login-card .btn { width: 100%; }

.register-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 100% 0%, rgba(224, 138, 44, 0.18), transparent 36%),
        var(--cream);
    padding: 1rem 0 2rem;
}
.register-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.register-top .brand,
.register-top .brand-title,
.register-top .brand-org {
    color: var(--primary-blue-dark);
}
.register-container { max-width: 800px; margin: 0 auto; padding: 0 1rem; }
.register-card {
    background: #fff;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}
.register-header { text-align: center; margin-bottom: 1.5rem; }
.register-header .hero-logo { width: 96px; height: 96px; }
.register-header h1 { color: var(--primary-blue-dark); margin-bottom: 0.35rem; }
.register-header p { color: var(--gray-600); margin: 0; }
.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-blue-dark);
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--gray-200);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.logo-preview {
    width: 140px;
    height: 140px;
    border: 2px dashed var(--gray-300);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.75rem 0 1rem;
    overflow: hidden;
    background: var(--gray-50);
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-preview i { font-size: 2.5rem; color: var(--gray-400); }
.social-network-item {
    background: var(--gray-50);
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--gray-200);
}
.social-network-item .form-row { align-items: end; }
.btn-remove-social {
    background: var(--danger-red);
    color: #fff;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    min-height: 44px;
}
.form-actions { margin-top: 1.75rem; }
.form-actions .btn { width: 100%; }

.table-scroll-hint {
    display: none;
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .hero { padding: 1.5rem 1rem 2rem; align-items: flex-start; }
    .hero-logo { width: 112px; height: 112px; }
    .hero h1 { font-size: 1.85rem; }
    .hero p, .hero-org { font-size: 0.95rem; }
    .hero-buttons { flex-direction: column; }
    .hero-btn { width: 100%; }
    .nav-menu-inner { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .nav-item {
        border-inline-start: none;
        border-bottom: 1px solid var(--gray-200);
        padding: 0.7rem 0.25rem;
        font-size: 0.78rem;
    }
    .nav-item i { font-size: 1.1rem; }
    .site-header-inner { align-items: flex-start; }
    .brand-title { font-size: 1rem; }
    .form-row { grid-template-columns: 1fr; }
    .register-card { padding: 1.15rem; }
    .charts-row { grid-template-columns: 1fr !important; }
    .filters-row { grid-template-columns: 1fr !important; }
    .table-scroll-hint { display: block; }
    .btn, .tab, .nav-item { min-height: 44px; }
}

@media (max-width: 520px) {
    .site-header-inner { flex-direction: column; }
    .user-info { width: 100%; justify-content: space-between; }
    .brand-org { font-size: 0.7rem; }
    .login-card { padding: 1.5rem 1rem; }
}
