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

body {
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: #fff;
    font-family: 'Tajawal', sans-serif;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================
   Header
   ========================================== */
.header {
    background: rgba(26, 32, 44, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo{
    display: flex;
align-items: center;
}
.logo h1 {
    font-size: 28px;
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span {
    font-size: 14px;
    opacity: 0.8;
    margin-right: 10px;
    color: #a0aec0;
}

/* ==========================================
   الأزرار
   ========================================== */
.btn {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 16px;
}

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

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

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-scan {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    padding: 15px 35px;
    font-size: 18px;
}

.btn-scan:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(245, 87, 108, 0.4);
}

.btn-share {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
}

.btn-pdf {
    background: linear-gradient(135deg, #fa709a, #fee140);
    color: #1a202c;
}

/* ==========================================
   قسم Hero
   ========================================== */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 80px 0;
    border-radius: 0 0 50px 50px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    text-align: center;
}

.hero h2 {
    font-size: 36px;
    margin-bottom: 15px;
}

.hero p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 30px;
}

.scan-box {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    max-width: 700px;
    margin: 0 auto;
}

.scan-input {
    flex: 1;
    min-width: 250px;
    padding: 15px 20px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    outline: none;
    background: rgba(255,255,255,0.9);
    color: #1a202c;
}

.scan-input:focus {
    box-shadow: 0 0 0 3px #f5576c;
}

/* ==========================================
   شاشة التحميل
   ========================================== */
.loading {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   النتائج
   ========================================== */
.results {
    padding: 40px 0;
}

.results.hidden {
    display: none;
}

.results h3 {
    font-size: 28px;
    margin-bottom: 20px;
    text-align: center;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

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

.result-card {
    animation: fadeInUp 0.5s ease forwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 16px;
    color: #fff;
}

.result-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.result-card .tech-name {
    font-size: 20px;
    font-weight: 700;
}

.result-card .tech-category {
    font-size: 14px;
    opacity: 0.8;
    margin: 5px 0;
}

.result-card .tech-confidence {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    margin-top: 10px;
}

.conf-high {
    background: rgba(72, 187, 120, 0.3);
    color: #48bb78;
}

.conf-medium {
    background: rgba(237, 137, 54, 0.3);
    color: #ed8936;
}

.conf-low {
    background: rgba(245, 101, 101, 0.3);
    color: #f56565;
}

/* ==========================================
   لوحة التحكم
   ========================================== */
.dashboard {
    padding: 40px 0;
    background: rgba(255,255,255,0.05);
    border-radius: 30px;
    margin: 20px 0;
}

.dashboard.hidden {
    display: none;
}

.dashboard h3 {
    font-size: 28px;
    margin-bottom: 20px;
}

.dashboard table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.dashboard th {
    background: rgba(102, 126, 234, 0.3);
    padding: 12px;
    text-align: right;
}

.dashboard td {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.dashboard tr:hover {
    background: rgba(255,255,255,0.05);
}

/* ==========================================
   النوافذ المنبثقة
   ========================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #1a202c;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    position: relative;
    border: 1px solid rgba(255,255,255,0.1);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #fff;
}

.modal-content input {
    width: 100%;
    padding: 12px 15px;
    margin: 10px 0;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-size: 16px;
}

.modal-content input:focus {
    border-color: #667eea;
    outline: none;
}

.modal-content .btn {
    width: 100%;
    margin-top: 10px;
}

.close {
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #a0aec0;
}

.close:hover {
    color: #fff;
}



/* ==========================================
   Comparison Table Styles
   ========================================== */

#compareModal .modal-content {
    background: #1a202c;
    padding: 30px;
    border-radius: 20px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

#compareModal input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 12px;
    border-radius: 10px;
    width: 100%;
    margin: 5px 0;
}

#compareModal input:focus {
    border-color: #667eea;
    outline: none;
}

#compareModal table {
    color: #fff;
}

#compareModal th {
    background: #667eea !important;
    color: white;
    padding: 12px !important;
    text-align: center;
}

#compareModal td {
    padding: 10px !important;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-align: center;
}

#compareModal tr:hover {
    background: rgba(255,255,255,0.03);
}

#compareModal .close {
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #a0aec0;
}

#compareModal .close:hover {
    color: #fff;
}

/* ==========================================
   استجابة للشاشات الصغيرة
   ========================================== */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 28px;
    }
    .scan-box {
        flex-direction: column;
        padding: 0 20px;
    }
    .scan-input {
        min-width: 100%;
    }
    .header .container {
        flex-direction: column;
        gap: 10px;
    }
    .results-grid {
        grid-template-columns: 1fr;
    }
}



#rulesManager {
    margin-top: 30px; 
    padding: 20px; 
    background: rgba(255,255,255,0.05); 
    border-radius: 12px;
}

.rules-form-container {
    background: rgba(0,0,0,0.2); 
    padding: 20px; 
    border-radius: 10px; 
    margin-bottom: 25px;
    border: 1px solid rgba(255,255,255,0.05);
}

.rules-form-container h5 {
    margin-bottom: 15px; 
    color: #a0aec0; 
    font-size: 16px;
}

.rules-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 12px;
    color: #cbd5e0;
    font-weight: 500;
}

.form-group input, 
.form-group select {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 14px;
    font-family: 'Tajawal', sans-serif;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-group input:focus, 
.form-group select:focus {
    border-color: #667eea;
    background: rgba(255,255,255,0.15);
}

.form-group select option {
    background: #1a202c;
    color: #fff;
}

/* Rules Table */
#rulesListContainer table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 10px;
}

#rulesListContainer th {
    background: rgba(102, 126, 234, 0.2);
    padding: 12px 10px;
    text-align: right;
    font-weight: 600;
    color: #e2e8f0;
    border-bottom: 2px solid rgba(102, 126, 234, 0.4);
}

#rulesListContainer td {
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: middle;
}

#rulesListContainer tr:hover {
    background: rgba(255,255,255,0.03);
}