/* نظام مقايسة مشاريع IoT - الستايل الموحد */

* { 
    font-family: 'Tajawal', sans-serif; 
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
    min-height: 100vh; 
    padding: 20px; 
}

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

/* الكروت */
.card { 
    background: white; 
    border-radius: 20px; 
    padding: 30px; 
    box-shadow: 0 20px 60px rgba(0,0,0,0.15); 
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.8);
}

/* بطاقات الإحصائيات */
.stat-card { 
    background: linear-gradient(135deg, #667eea, #764ba2); 
    color: white; 
    border-radius: 15px; 
    padding: 30px 25px; 
    text-align: center; 
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(255,255,255,0.2);
}

.stat-card:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 20px 50px rgba(102, 126, 234, 0.4);
}

.stat-card i {
    opacity: 0.9;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

/* الأزرار */
.btn { 
    padding: 12px 24px; 
    border-radius: 10px; 
    font-weight: 600; 
    transition: all 0.3s; 
    cursor: pointer; 
    border: none; 
    text-decoration: none; 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.btn-primary { 
    background: linear-gradient(135deg, #667eea, #764ba2); 
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary { 
    background: white; 
    color: #374151;
    border: 2px solid #e5e7eb;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 8px 20px rgba(0,0,0,0.15); 
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* حقول الإدخال */
.form-input, .form-select { 
    width: 100%; 
    padding: 12px 16px; 
    border: 2px solid #e5e7eb; 
    border-radius: 10px; 
    transition: all 0.3s;
    background: white;
    font-size: 14px;
    font-weight: 500;
}

.form-input:focus, .form-select:focus { 
    outline: none; 
    border-color: #667eea; 
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    background: #fafbff;
}

.form-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

/* الجداول */
.data-table { 
    width: 100%; 
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th { 
    background: linear-gradient(135deg, #f9fafb, #f3f4f6); 
    padding: 16px; 
    text-align: right; 
    font-weight: 700; 
    border-bottom: 2px solid #e5e7eb;
    color: #374151;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td { 
    padding: 16px; 
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}

.data-table tbody tr { 
    transition: all 0.2s;
}

.data-table tbody tr:hover { 
    background: #fafbff;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* الشارات (Badges) */
.badge { 
    padding: 6px 14px; 
    border-radius: 20px; 
    font-size: 12px; 
    font-weight: 700; 
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.3px;
}

.badge-blue { 
    background: linear-gradient(135deg, #3b82f6, #2563eb); 
    color: white; 
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3); 
}

.badge-green { 
    background: linear-gradient(135deg, #10b981, #059669); 
    color: white; 
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3); 
}

.badge-orange { 
    background: linear-gradient(135deg, #f59e0b, #d97706); 
    color: white; 
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3); 
}

.badge-red { 
    background: linear-gradient(135deg, #ef4444, #dc2626); 
    color: white; 
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3); 
}

.badge-purple { 
    background: linear-gradient(135deg, #8b5cf6, #7c3aed); 
    color: white; 
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3); 
}

.badge-pink {
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: white;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

/* أزرار الأيقونات */
.btn-icon { 
    width: 38px; 
    height: 38px; 
    border-radius: 10px; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    transition: all 0.3s; 
    cursor: pointer; 
    border: none;
    font-size: 14px;
}

.btn-icon-blue { 
    background: linear-gradient(135deg, #3b82f6, #2563eb); 
    color: white; 
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3); 
}

.btn-icon-green { 
    background: linear-gradient(135deg, #10b981, #059669); 
    color: white; 
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3); 
}

.btn-icon-purple { 
    background: linear-gradient(135deg, #8b5cf6, #7c3aed); 
    color: white; 
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3); 
}

.btn-icon-orange { 
    background: linear-gradient(135deg, #f59e0b, #d97706); 
    color: white; 
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3); 
}

.btn-icon-red { 
    background: linear-gradient(135deg, #ef4444, #dc2626); 
    color: white; 
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3); 
}

.btn-icon:hover { 
    transform: translateY(-3px) scale(1.05); 
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* التنبيهات */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border: 2px solid #10b981;
}

.alert-error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border: 2px solid #ef4444;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border: 2px solid #f59e0b;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    border: 2px solid #3b82f6;
}

/* Grid System */
.grid {
    display: grid;
    gap: 20px;
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-cols-2, .grid-cols-3, .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

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

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.font-bold { font-weight: 700; }
.text-sm { font-size: 14px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 30px; }
.text-4xl { font-size: 36px; }

.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }

.text-blue-600 { color: #2563eb; }
.text-green-600 { color: #059669; }
.text-red-600 { color: #dc2626; }
.text-purple-600 { color: #7c3aed; }

.bg-gray-50 { background: #f9fafb; }
.bg-blue-50 { background: #eff6ff; }
.bg-green-50 { background: #f0fdf4; }
.bg-yellow-50 { background: #fefce8; }

.rounded { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }

.shadow { box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.shadow-md { box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.shadow-lg { box-shadow: 0 10px 15px rgba(0,0,0,0.1); }

.border { border: 1px solid #e5e7eb; }
.border-t { border-top: 1px solid #e5e7eb; }
.border-b { border-bottom: 1px solid #e5e7eb; }

.overflow-x-auto { overflow-x: auto; }
.overflow-hidden { overflow: hidden; }

.w-full { width: 100%; }
.h-full { height: 100%; }

/* Main Content Area */
.main-content {
    width: 100%;
}

/* Content Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

/* Space utilities */
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-6 > * + * { margin-top: 24px; }

.pt-3 { padding-top: 12px; }
.pt-4 { padding-top: 16px; }
.pt-6 { padding-top: 24px; }
.pb-3 { padding-bottom: 12px; }
.pb-6 { padding-bottom: 24px; }

/* Flex utilities */
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }

/* Min width */
.min-w-200 { min-width: 200px; }

/* Button sizes */
.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* Table improvements */
table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: #f9fafb;
    padding: 12px;
    text-align: right;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    color: #374151;
}

table td {
    padding: 12px;
    border: 1px solid #e5e7eb;
}

table tbody tr:hover {
    background: #f9fafb;
}

/* Sticky positioning */
.sticky {
    position: sticky;
}

.top-6 {
    top: 24px;
}

.top-20 {
    top: 80px;
}

/* Opacity */
.opacity-50 { opacity: 0.5; }
.opacity-90 { opacity: 0.9; }

/* Transitions */
.transition-all { transition: all 0.3s; }
.transition-shadow { transition: box-shadow 0.3s; }

/* Hover effects */
.hover\:shadow-md:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Background gradients */
.bg-gradient-to-br {
    background: linear-gradient(to bottom right, var(--tw-gradient-from), var(--tw-gradient-to));
}

.from-blue-50 { --tw-gradient-from: #eff6ff; }
.to-purple-50 { --tw-gradient-to: #faf5ff; }

/* Text colors */
.text-yellow-600 { color: #d97706; }

/* Icon sizes */
.text-5xl { font-size: 48px; }
.text-6xl { font-size: 60px; }

/* Hidden */
.hidden { display: none; }

/* Responsive Grid */
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:col-span-1 { grid-column: span 1; }
    .lg\:col-span-2 { grid-column: span 2; }
}

/* Responsive */
@media (max-width: 1024px) {
    body { padding: 15px; }
    .card { padding: 20px; }
    .content-header {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    body { padding: 10px; }
    .card { padding: 15px; }
    .stat-card { padding: 20px 15px; }
    .text-3xl { font-size: 24px; }
    .text-4xl { font-size: 28px; }
    
    table {
        font-size: 13px;
    }
    
    table th, table td {
        padding: 8px;
    }
}
