/**
 * TM Nice Classifier - Styles
 */

/* ======= الواجهة الأمامية ======= */
.tmnc-container {
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    padding: 20px;
}

/* مربع البحث */
.tmnc-search-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.tmnc-search-title {
    color: #fff;
    text-align: center;
    font-size: 28px;
    margin-bottom: 30px;
    font-weight: 700;
}

.tmnc-search-wrapper {
    display: flex;
    gap: 15px;
    max-width: 700px;
    margin: 0 auto;
    background: #fff;
    border-radius: 50px;
    padding: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.tmnc-search-input {
    flex: 1;
    border: none;
    padding: 15px 25px;
    font-size: 18px;
    background: transparent;
    outline: none;
    direction: rtl;
}

.tmnc-search-input::placeholder {
    color: #999;
}

.tmnc-search-btn {
    background: #25D366;
    color: #fff;
    border: none;
    padding: 15px 35px;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tmnc-search-btn:hover {
    background: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
}

.tmnc-search-btn i {
    font-size: 18px;
}

/* نتائج البحث */
.tmnc-results {
    margin-top: 30px;
    display: none;
}

.tmnc-results.active {
    display: block;
}

.tmnc-results-title {
    font-size: 20px;
    color: #333;
    margin-bottom: 20px;
    padding-right: 10px;
    border-right: 4px solid #667eea;
}

.tmnc-result-card {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border-right: 5px solid #667eea;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tmnc-result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.tmnc-result-card.best-match {
    border-right-color: #25D366;
    background: linear-gradient(to left, rgba(37, 211, 102, 0.05), transparent);
}

.tmnc-result-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.tmnc-result-icon {
    font-size: 40px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
}

.tmnc-result-card.best-match .tmnc-result-icon {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.tmnc-result-info {
    flex: 1;
}

.tmnc-result-class {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.tmnc-result-name {
    font-size: 18px;
    color: #666;
}

.tmnc-result-score {
    background: #f0f0f0;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    color: #667eea;
    font-weight: 600;
}

.tmnc-result-card.best-match .tmnc-result-score {
    background: rgba(37, 211, 102, 0.1);
    color: #25D366;
}

.tmnc-result-description {
    color: #888;
    font-size: 14px;
    margin-bottom: 15px;
    padding-right: 75px;
}

.tmnc-result-reasons {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.tmnc-reasons-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 600;
}

.tmnc-reason-tag {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    margin: 3px;
}

.tmnc-reason-tag.exact {
    background: #d4edda;
    color: #155724;
}

.tmnc-reason-tag.partial {
    background: #fff3cd;
    color: #856404;
}

.tmnc-reason-tag.similar {
    background: #d1ecf1;
    color: #0c5460;
}

.tmnc-result-actions {
    display: flex;
    gap: 10px;
    padding-right: 75px;
}

.tmnc-btn {
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tmnc-btn-primary {
    background: #25D366;
    color: #fff;
}

.tmnc-btn-primary:hover {
    background: #128C7E;
}

.tmnc-btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.tmnc-btn-secondary:hover {
    background: #e0e0e0;
}

/* رسالة عدم العثور على نتائج */
.tmnc-no-results {
    text-align: center;
    padding: 40px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.tmnc-no-results-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.tmnc-no-results-title {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
}

.tmnc-no-results-text {
    color: #888;
    margin-bottom: 20px;
}

.tmnc-suggestions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.tmnc-suggestion-chip {
    background: #f0f0f0;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tmnc-suggestion-chip:hover {
    background: #667eea;
    color: #fff;
}

/* الشبكة البصرية */
.tmnc-grid-section {
    margin-top: 50px;
}

.tmnc-section-title {
    font-size: 22px;
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tmnc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.tmnc-grid-card {
    background: #fff;
    border-radius: 15px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 3px 15px rgba(0,0,0,0.05);
}

.tmnc-grid-card:hover {
    transform: translateY(-5px);
    border-color: #667eea;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.tmnc-grid-icon {
    font-size: 40px;
    margin-bottom: 10px;
    display: block;
}

.tmnc-grid-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.4;
}

.tmnc-grid-class {
    font-size: 12px;
    color: #888;
}

/* مؤشر التحميل */
.tmnc-loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.tmnc-loading.active {
    display: block;
}

.tmnc-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: tmnc-spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* رسالة الواتساب */
.tmnc-whatsapp-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.tmnc-whatsapp-modal.active {
    display: flex;
}

.tmnc-whatsapp-content {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.tmnc-whatsapp-title {
    font-size: 22px;
    color: #333;
    margin-bottom: 20px;
}

.tmnc-whatsapp-message {
    background: #f0f0f0;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: right;
    font-size: 16px;
    line-height: 1.8;
}

.tmnc-whatsapp-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ======= لوحة التحكم ======= */
.tmnc-admin-wrap {
    max-width: 1200px;
    margin: 20px 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.tmnc-admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.tmnc-admin-title {
    font-size: 28px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.tmnc-admin-title span {
    font-size: 36px;
}

.tmnc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.tmnc-stat-card {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    text-align: center;
    transition: all 0.3s ease;
}

.tmnc-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.tmnc-stat-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.tmnc-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.tmnc-stat-label {
    color: #888;
    font-size: 14px;
}

.tmnc-admin-section {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.05);
}

.tmnc-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.tmnc-section-title {
    font-size: 20px;
    color: #333;
    margin: 0;
}

.tmnc-table {
    width: 100%;
    border-collapse: collapse;
}

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

.tmnc-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.tmnc-table tr:hover {
    background: #f8f9fa;
}

.tmnc-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.tmnc-badge-intent {
    background: #d4edda;
    color: #155724;
}

.tmnc-badge-synonym {
    background: #fff3cd;
    color: #856404;
}

.tmnc-badge-pending {
    background: #f8d7da;
    color: #721c24;
}

.tmnc-badge-linked {
    background: #d1ecf1;
    color: #0c5460;
}

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

.tmnc-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.tmnc-form-input,
.tmnc-form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tmnc-form-input:focus,
.tmnc-form-select:focus {
    outline: none;
    border-color: #667eea;
}

.tmnc-btn-add {
    background: #25D366;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tmnc-btn-add:hover {
    background: #128C7E;
}

.tmnc-btn-link {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tmnc-btn-link:hover {
    background: #5a6fd6;
}

.tmnc-btn-delete {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tmnc-btn-delete:hover {
    background: #c82333;
}

/* تصميم متجاوب */
@media (max-width: 768px) {
    .tmnc-search-wrapper {
        flex-direction: column;
        border-radius: 20px;
    }
    
    .tmnc-search-btn {
        width: 100%;
        justify-content: center;
    }
    
    .tmnc-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .tmnc-result-actions {
        flex-direction: column;
        padding-right: 0;
    }
    
    .tmnc-result-description {
        padding-right: 0;
    }
}
