/* Main CSS for Markeystem - Kurdish Accounting System */

/* Unicode and Kurdish Text Support */
@charset "UTF-8";

/* Font Setup with proper Unicode support */
* { 
    font-family: 'Noto Kufi Arabic', 'Segoe UI', 'Roboto', 'Arial Unicode MS', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* RTL Support for Kurdish text */
.font-kurdish, [lang="ku"] {
    direction: rtl;
    text-align: right;
    font-family: 'Noto Kufi Arabic', 'Segoe UI', sans-serif;
    unicode-bidi: bidi-override;
}

/* Unicode icon support */
.icon-unicode {
    font-family: 'Segoe UI Symbol', 'Segoe UI Emoji', 'Apple Color Emoji', 'Twemoji Mozilla', 'Noto Color Emoji', 'EmojiOne Color', 'Android Emoji';
    font-variant-emoji: emoji;
    text-rendering: optimizeLegibility;
}

/* Core Animations */
.fade-in { 
    animation: fadeIn 0.6s ease-out; 
}

.fade-in-up { 
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1); 
}

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

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

/* Hover Effects */
.hover-scale { 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
}

.hover-scale:hover { 
    transform: scale(1.02) translateY(-2px); 
    box-shadow: 0 10px 25px rgba(0,0,0,0.15); 
}

.hover-lift {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* Glass Effects */
.glass-effect { 
    backdrop-filter: blur(10px); 
    background: rgba(255, 255, 255, 0.9); 
}

.glass {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.glass-card {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Text Effects */
.gradient-text { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
}

/* Card Effects */
.card-hover { 
    transition: all 0.3s ease; 
}

.card-hover:hover { 
    box-shadow: 0 20px 40px rgba(0,0,0,0.1); 
}

/* Animation Effects */
.pulse-animation { 
    animation: pulse 2s infinite; 
}

@keyframes pulse { 
    0%, 100% { opacity: 1; } 
    50% { opacity: 0.7; } 
}

.floating { 
    animation: floating 3s ease-in-out infinite; 
}

@keyframes floating { 
    0%, 100% { transform: translateY(0px); } 
    50% { transform: translateY(-5px); } 
}

.pulse-glow { 
    animation: pulse-glow 2s infinite; 
}

@keyframes pulse-glow { 
    0%, 100% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.4); } 
    50% { box-shadow: 0 0 40px rgba(102, 126, 234, 0.8); } 
}

/* Background Effects */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    position: relative;
}

.gradient-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
}

/* Button Styles */
.btn-modern {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-modern:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-modern:hover:before {
    left: 100%;
}

.btn-success { 
    background: linear-gradient(135deg, #10b981 0%, #059669 100%); 
}

.btn-success:hover { 
    background: linear-gradient(135deg, #059669 0%, #047857 100%); 
}

/* Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

/* Product Search Suggestions */
.product-suggestion {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    margin: 2px 0;
}

.product-suggestion:hover {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-right: 4px solid #3b82f6;
    transform: translateX(-3px);
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .fade-in-up {
        animation: fadeInUpMobile 0.6s ease-out;
    }
    
    @keyframes fadeInUpMobile {
        from { opacity: 0; transform: translateY(20px); }
        to { opacity: 1; transform: translateY(0); }
    }
    
    /* Mobile-friendly button spacing */
    .btn-mobile {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* Mobile table scroll */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mobile form improvements */
    .form-control-mobile {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px;
        border-radius: 8px;
    }
    
    /* Mobile-friendly cards */
    .card-mobile {
        margin: 8px;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    }
    
    /* Mobile modal fixes */
    .modal {
        padding: 5px !important;
        align-items: flex-start !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .modal-content {
        width: 100% !important;
        max-width: none !important;
        max-height: calc(100vh - 10px) !important;
        margin: 5px 0 !important;
        padding: 12px !important;
        border-radius: 8px !important;
        position: relative !important;
    }
    
    .modal-header {
        padding: 12px 16px 8px !important;
        margin-bottom: 16px !important;
    }
    
    .modal-title {
        font-size: 16px !important;
    }
    
    .modal-body {
        padding: 0 16px 16px !important;
    }
    
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .form-group {
        margin-bottom: 12px !important;
    }
    
    .form-control {
        font-size: 16px !important;
        padding: 12px !important;
        border-radius: 6px !important;
    }
    
    .btn {
        padding: 12px 16px !important;
        font-size: 14px !important;
        min-height: 44px !important;
        touch-action: manipulation !important;
    }
    
    .modal-close {
        width: 28px !important;
        height: 28px !important;
        top: 8px !important;
        right: 8px !important;
    }
}

/* Extra small screens (phones) */
@media (max-width: 480px) {
    .modal {
        padding: 2px !important;
    }
    
    .modal-content {
        width: calc(100% - 4px) !important;
        margin: 2px !important;
        padding: 8px !important;
        border-radius: 6px !important;
        max-height: calc(100vh - 4px) !important;
    }
    
    .modal-header {
        padding: 8px 12px 6px !important;
        margin-bottom: 12px !important;
    }
    
    .modal-title {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }
    
    .modal-body {
        padding: 0 12px 12px !important;
    }
    
    .form-group {
        margin-bottom: 8px !important;
    }
    
    .form-group label {
        font-size: 14px !important;
        margin-bottom: 4px !important;
    }
    
    .form-control {
        font-size: 16px !important;
        padding: 8px !important;
        height: auto !important;
        min-height: 40px !important;
    }
    
    .btn {
        padding: 8px 12px !important;
        font-size: 13px !important;
        min-height: 40px !important;
    }
    
    .modal-close {
        width: 24px !important;
        height: 24px !important;
        top: 6px !important;
        right: 6px !important;
        font-size: 16px !important;
    }
}

/* Tablet Responsive Design */
@media (min-width: 769px) and (max-width: 1024px) {
    .hover-scale:hover {
        transform: scale(1.01) translateY(-1px);
    }
    
    .btn-tablet {
        padding: 10px 16px;
        font-size: 15px;
    }
}

/* Desktop enhancements */
@media (min-width: 1025px) {
    .desktop-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 24px;
    }
    
    .desktop-hover:hover {
        transform: translateY(-4px) scale(1.02);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    }
}

/* Cross-browser compatibility fixes */
.input-fix {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.select-fix {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="m2 0-2 2h4zm0 5 2-2h-4z"/></svg>');
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 12px;
    padding-left: 40px;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-friendly {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Accessibility improvements */
.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Performance optimizations */
.will-change-transform {
    will-change: transform;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Kurdish text improvements */
.kurdish-text {
    font-feature-settings: "liga" 1, "kern" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Loading states */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    transform: translateX(4px);
    border-left: 4px solid #0ea5e9;
}

/* Utility Classes */
.z-high { z-index: 9999; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.overflow-hidden { overflow: hidden; }

/* Responsive Design Helpers */
@media (max-width: 768px) {
    .hover-scale:hover,
    .hover-lift:hover {
        transform: none;
        box-shadow: none;
    }
    
    .floating {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .glass-effect,
    .glass,
    .glass-card {
        background: white !important;
        backdrop-filter: none !important;
        border: 1px solid #ddd !important;
    }
    
    * {
        color: black !important;
        background: white !important;
    }
}

/* Tailwind CSS Overrides - These must come last */
.dashboard-nav {
    background: linear-gradient(to right, #1e40af, #1e3a8a, #7c3aed) !important;
}

.quick-actions-bar {
    background: linear-gradient(to right, #f9fafb, #eff6ff) !important;
}

.stats-card-green {
    background: linear-gradient(to bottom right, #10b981, #059669, #047857) !important;
}

.stats-card-blue {
    background: linear-gradient(to bottom right, #3b82f6, #2563eb, #1d4ed8) !important;
}

.stats-card-purple {
    background: linear-gradient(to bottom right, #8b5cf6, #7c3aed, #6d28d9) !important;
}

.stats-card-red {
    background: linear-gradient(to bottom right, #ef4444, #dc2626, #b91c1c) !important;
}

.nav-store-name {
    color: white !important;
}

/* Force font family on all elements */
*, *::before, *::after {
    font-family: 'Noto Kufi Arabic', sans-serif !important;
}

/* Modal Display Fixes for Kurdish Interface */

/* Fix modal overlay and positioning */
.modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    z-index: 10000 !important;
    /* display: flex !important; */ /* REMOVED - let JavaScript control display */
    align-items: center !important;
    justify-content: center !important;
    padding: 10px !important;
}

/* Show modal when it has 'show' class or display style set */
.modal[style*="display: block"],
.modal.show {
    display: flex !important;
}

.modal-content {
    background: white !important;
    border-radius: 12px !important;
    padding: 16px !important;
    width: 100% !important;
    max-width: 600px !important;
    max-height: calc(100vh - 20px) !important;
    overflow-y: auto !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3) !important;
    direction: rtl !important;
    font-family: 'Noto Kufi Arabic', sans-serif !important;
    z-index: 10001 !important;
    position: relative !important;
    margin: 0 !important;
}

/* Fix modal close button */
.modal-close {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    background: #f3f4f6 !important;
    border: none !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    z-index: 10002 !important;
}

.modal-close:hover {
    background: #e5e7eb !important;
    transform: scale(1.1) !important;
}

/* Fix modal header */
.modal-header {
    text-align: right !important;
    direction: rtl !important;
    margin-bottom: 20px !important;
    border-bottom: 2px solid #f3f4f6 !important;
    padding-bottom: 16px !important;
}

.modal-title {
    font-size: 20px !important;
    font-weight: bold !important;
    color: #1f2937 !important;
    margin: 0 !important;
}

/* Fix modal body */
.modal-body {
    direction: rtl !important;
    text-align: right !important;
    line-height: 1.6 !important;
}

/* Fix error message styling */
.error-message {
    color: #dc2626 !important;
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    border-radius: 8px !important;
    padding: 16px !important;
    margin: 16px 0 !important;
    direction: rtl !important;
    text-align: right !important;
}

/* Fix success message styling */
.success-message {
    color: #059669 !important;
    background: #ecfdf5 !important;
    border: 1px solid #a7f3d0 !important;
    border-radius: 8px !important;
    padding: 16px !important;
    margin: 16px 0 !important;
    direction: rtl !important;
    text-align: right !important;
}

/* Fix warning message styling */
.warning-message {
    color: #d97706 !important;
    background: #fffbeb !important;
    border: 1px solid #fed7aa !important;
    border-radius: 8px !important;
    padding: 16px !important;
    margin: 16px 0 !important;
    direction: rtl !important;
    text-align: right !important;
}

/* Ensure proper stacking order */
.navbar {
    z-index: 1000 !important;
}

.sidebar {
    z-index: 1001 !important;
}

.dropdown {
    z-index: 1002 !important;
}

.modal-backdrop {
    z-index: 9999 !important;
}

/* Fix notification positioning */
.notification {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 10005 !important;
    max-width: 400px !important;
    border-radius: 8px !important;
    padding: 16px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
    direction: rtl !important;
    text-align: right !important;
}

/* Accessibility improvements */
.modal[aria-hidden="true"] {
    display: none !important;
}

.modal[aria-hidden="false"] {
    display: flex !important;
}

/* Animation for smooth modal appearance */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content {
    animation: modalFadeIn 0.3s ease-out !important;
}

/* Fix for RTL text in modals */
.modal p,
.modal span,
.modal div {
    direction: rtl !important;
    text-align: right !important;
}

/* Override any conflicting styles */
.modal * {
    box-sizing: border-box !important;
}

/* Fix for select dropdowns in modals */
.modal select {
    direction: rtl !important;
    text-align: right !important;
    background-position: left 12px center !important;
}

/* Additional UI fixes */
.alert {
    direction: rtl !important;
    text-align: right !important;
    border-radius: 8px !important;
    padding: 16px !important;
    margin: 16px 0 !important;
}

.alert-danger {
    color: #dc2626 !important;
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
}

.alert-success {
    color: #059669 !important;
    background: #ecfdf5 !important;
    border: 1px solid #a7f3d0 !important;
}

.alert-warning {
    color: #d97706 !important;
    background: #fffbeb !important;
    border: 1px solid #fed7aa !important;
}

.alert-info {
    color: #0369a1 !important;
    background: #f0f9ff !important;
    border: 1px solid #7dd3fc !important;
}
