:root {
    /* Colors */
    --primary-color: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --danger-color: #dc2626;
    --success-color: #16a34a;
    
    /* Neutral Colors */
    --white: #ffffff;
    --bg-color: #f8f9fa;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    
    /* Layout */
    --sidebar-width: 240px;
    --header-height: 64px;
    --sidebar-collapsed-width: 72px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rubik', 'Assistant', 'Heebo', 'Noto Sans Hebrew', 'David Libre', 'Frank Ruehl CLM', 'Arial Unicode MS', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    direction: rtl;
    -webkit-font-feature-settings: "liga", "kern";
    font-feature-settings: "liga", "kern";
    text-rendering: optimizeLegibility;
}

/* Button styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1557b0;
}

.btn-danger {
    background-color: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

/* Form styles */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    padding-right: 2.5rem; /* Space for icon */
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

/* Input with icon styles */
.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 1.1rem;
}

.input-with-icon input:focus + i {
    color: var(--primary-color);
}

/* Card styles */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

/* Message styles */
.message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.message-error {
    background-color: #fee2e2;
    color: var(--error-color);
}

.message-success {
    background-color: #dcfce7;
    color: var(--success-color);
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Utilities */
.responsive-hide-mobile {
    display: block;
}

.responsive-show-mobile {
    display: none;
}

.mobile-hide {
    display: table-cell;
}

.mobile-stack {
    display: table-row;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .responsive-hide-mobile {
        display: none !important;
    }
    
    .responsive-show-mobile {
        display: block !important;
    }
    
    .mobile-hide {
        display: none !important;
    }
    
    .mobile-stack {
        display: block !important;
        border: none !important;
        border-bottom: 1px solid #e5e7eb !important;
        padding: 16px !important;
        margin-bottom: 16px !important;
        background: white !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    }
    
    .mobile-stack td {
        display: block !important;
        width: 100% !important;
        padding: 8px 0 !important;
        border: none !important;
        text-align: right !important;
    }
    
    .mobile-stack td:before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: #374151;
        display: inline-block;
        width: 120px;
        margin-left: 10px;
    }
    
    .mobile-stack td:first-child:before {
        display: none;
    }
    
    /* Table responsive wrapper */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive table {
        min-width: 600px;
    }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .responsive-hide-tablet {
        display: none !important;
    }
    
    .responsive-show-tablet {
        display: block !important;
    }
}

/* Desktop Large */
@media (min-width: 1200px) {
    .responsive-hide-desktop {
        display: none !important;
    }
    
    .responsive-show-desktop {
        display: block !important;
    }
}

/* Touch-friendly buttons on mobile */
@media (max-width: 768px) {
    button, .btn, a.btn {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    input, select, textarea {
        min-height: 44px;
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}
