/* نظام إدارة المخزون - التصميم الرئيسي */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@100..900&family=Noto+Sans:wght@100..900&family=Amiri:wght@400;700&family=Scheherazade+New:wght@400;700&display=swap');

/* Custom Kurdish Font - Rudaw Regular */
@font-face {
    font-family: 'Rudaw Regular';
    src: url('../fonts/rudawregular2.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Noto Sans Arabic', 'Amiri', sans-serif;
    direction: rtl;
    text-align: right;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Enhanced font support for different languages */
[lang="ar"], .arabic-text {
    font-family: 'Cairo', 'Noto Sans Arabic', 'Amiri', 'Tahoma', sans-serif;
}

[lang="en"], .english-text {
    font-family: 'Noto Sans', 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    direction: ltr;
    text-align: left;
}

[lang="ku"], .kurdish-text {
    font-family: 'Rudaw Regular', 'Scheherazade New', 'Noto Sans Arabic', 'Amiri', 'KufiStandardGK', 'Arial Unicode MS', 'Tahoma', sans-serif;
    font-weight: 400;
    line-height: 1.8;
    letter-spacing: 0.3px;
}

/* Kurdish specific styling for better readability */
[lang="ku"] h1, [lang="ku"] h2, [lang="ku"] h3, [lang="ku"] h4, [lang="ku"] h5, [lang="ku"] h6 {
    font-family: 'Rudaw Regular', 'Scheherazade New', 'Noto Sans Arabic', 'Amiri', sans-serif;
    font-weight: 400;
    line-height: 1.6;
}

[lang="ku"] .navbar-brand,
[lang="ku"] .dashboard-title h1,
[lang="ku"] .category-card h3,
[lang="ku"] .table-header h2 {
    font-family: 'Rudaw Regular', 'Scheherazade New', 'Noto Sans Arabic', sans-serif;
    font-weight: 400;
}

[lang="ku"] .form-control,
[lang="ku"] .btn,
[lang="ku"] input,
[lang="ku"] textarea,
[lang="ku"] select {
    font-family: 'Rudaw Regular', 'Noto Sans Arabic', 'Scheherazade New', 'Amiri', sans-serif;
    font-size: 16px;
    line-height: 1.7;
}

/* English specific styling */
[lang="en"] {
    direction: ltr;
    text-align: left;
}

[lang="en"] .navbar-content {
    flex-direction: row-reverse;
}

[lang="en"] .data-table th,
[lang="en"] .data-table td {
    text-align: left;
}

[lang="en"] .category-card .btn i {
    margin-right: 8px;
    margin-left: 0;
}

/* تصميم صفحة تسجيل الدخول */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #4a5568;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.login-header p {
    color: #718096;
    font-size: 16px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f7fafc;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

/* تصميم لوحة التحكم الرئيسية */
.dashboard-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    color: white;
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
}

.navbar-user {
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-user span {
    font-weight: 600;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

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

/* بطاقات الفئات */
.dashboard-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.dashboard-title {
    text-align: center;
    margin-bottom: 40px;
}

.dashboard-title h1 {
    color: #4a5568;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
}

.dashboard-title p {
    color: #718096;
    font-size: 18px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.category-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.category-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
}

.category-card h3 {
    color: #4a5568;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.category-card p {
    color: #718096;
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.category-card .btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 25px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.category-card .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* تصميم الجداول */
.table-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
}

.table-header h2 {
    color: #4a5568;
    font-size: 28px;
    font-weight: 700;
}

.btn-add {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    padding: 12px 25px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.3);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    background: #f8fafc;
    color: #4a5568;
    font-weight: 700;
    font-size: 16px;
}

.data-table tr:hover {
    background: #f8fafc;
}

.status-active {
    background: #c6f6d5;
    color: #22543d;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-inactive {
    background: #fed7d7;
    color: #742a2a;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* تصميم النماذج */
.form-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.form-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
}

.form-header h2 {
    color: #4a5568;
    font-size: 28px;
    font-weight: 700;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

/* رسائل التنبيه */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.alert-error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
}

.alert-warning {
    background: #fefcbf;
    color: #744210;
    border: 1px solid #f6e05e;
}

/* Kurdish language specific improvements */
[lang="ku"] .alert,
[lang="ku"] .btn,
[lang="ku"] .form-control,
[lang="ku"] .navbar-brand,
[lang="ku"] .category-card h3 {
    font-family: 'Scheherazade New', 'Noto Sans Arabic', 'Amiri', sans-serif;
}

/* Enhanced Kurdish text rendering */
[lang="ku"] {
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* تصميم متجاوب */
@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .navbar-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .table-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .dashboard-content {
        padding: 20px 15px;
    }
    
    /* Mobile Kurdish text adjustments */
    [lang="ku"] {
        font-size: 15px;
        line-height: 1.8;
    }
    
    [lang="ku"] h1 {
        font-size: 28px;
    }
    
    [lang="ku"] h2 {
        font-size: 24px;
    }
    
    [lang="ku"] h3 {
        font-size: 20px;
    }
}