/* ============================================
   Admin Enhancements CSS
   ============================================ */

/* Dark Mode - New Design
   خلفية: أسود | كروت: رمادي | عناوين: أبيض | نصوص: بنفسجي
   ============================================ */

/* Dark Mode overrides removed - implementing via variables */

/* ============================================
   Smart Search Bar - Enhanced Design
   ============================================ */

.smart-search-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    margin: 0 20px;
}

.smart-search-input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.smart-search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.smart-search-input:focus {
    outline: none;
    border-color: rgba(155, 95, 255, 0.6);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 4px rgba(155, 95, 255, 0.2), 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.smart-search-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.8);
    pointer-events: none;
    font-size: 16px;
    transition: all 0.3s ease;
}

.smart-search-input:focus + .smart-search-icon {
    color: #9B5FFF;
    transform: translateY(-50%) scale(1.1);
}

.smart-search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: white;
    border: none;
    border-radius: 16px;
    margin-top: 0;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: none;
    z-index: 9999;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.smart-search-results.show {
    display: block;
}

/* Custom Scrollbar */
.smart-search-results::-webkit-scrollbar {
    width: 6px;
}

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

.smart-search-results::-webkit-scrollbar-thumb {
    background: #9B5FFF;
    border-radius: 10px;
}

.smart-search-results::-webkit-scrollbar-thumb:hover {
    background: #7A35FF;
}

.smart-search-result-item {
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    display: block;
    color: inherit;
}

.smart-search-result-item:first-child {
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.smart-search-result-item:last-child {
    border-bottom: none;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.smart-search-result-item:hover {
    background: linear-gradient(90deg, rgba(155, 95, 255, 0.08) 0%, rgba(155, 95, 255, 0.03) 100%);
    transform: translateX(-3px);
    border-right: 3px solid #9B5FFF;
}

.smart-search-result-item .result-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #9B5FFF 0%, #7A35FF 100%);
    color: white;
    border-radius: 10px;
    margin-left: 15px;
    flex-shrink: 0;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(155, 95, 255, 0.3);
}

.smart-search-result-item .result-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 1.4;
}

.smart-search-result-item .result-subtitle {
    font-size: 12px;
    color: #7f8c8d;
    line-height: 1.3;
}

/* Loading State */
.smart-search-results .loading-state {
    padding: 30px 20px;
    text-align: center;
    color: #7f8c8d;
}

.smart-search-results .loading-state i {
    animation: spin 1s linear infinite;
    margin-left: 10px;
    color: #9B5FFF;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Empty State */
.smart-search-results .empty-state {
    padding: 40px 20px;
    text-align: center;
    color: #95a5a6;
}

.smart-search-results .empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ecf0f1;
    display: block;
}

.smart-search-results .empty-state p {
    margin: 0;
    font-size: 14px;
}

/* Error State */
.smart-search-results .error-state {
    padding: 30px 20px;
    text-align: center;
    color: #e74c3c;
}

.smart-search-results .error-state i {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
}

/* Dark Mode Support */
[data-theme="dark"] .smart-search-input {
    background: rgba(42, 42, 42, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: #9B5FFF;
}

[data-theme="dark"] .smart-search-input::placeholder {
    color: rgba(155, 95, 255, 0.5);
}

[data-theme="dark"] .smart-search-input:focus {
    border-color: rgba(155, 95, 255, 0.6);
    background: rgba(42, 42, 42, 0.95);
    box-shadow: 0 0 0 4px rgba(155, 95, 255, 0.2), 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .smart-search-icon {
    color: rgba(155, 95, 255, 0.8);
}

[data-theme="dark"] .smart-search-results {
    background: #2a2a2a;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .smart-search-result-item {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .smart-search-result-item:hover {
    background: linear-gradient(90deg, rgba(155, 95, 255, 0.15) 0%, rgba(155, 95, 255, 0.05) 100%);
    border-right-color: #9B5FFF;
}

[data-theme="dark"] .smart-search-result-item .result-title {
    color: #FFFFFF;
}

[data-theme="dark"] .smart-search-result-item .result-subtitle {
    color: #9B5FFF;
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInLeft 0.3s ease;
}

.toast.success {
    border-right: 4px solid #28a745;
}

.toast.error {
    border-right: 4px solid #dc3545;
}

.toast.info {
    border-right: 4px solid #17a2b8;
}

.toast.warning {
    border-right: 4px solid #ffc107;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   Progress Indicators
   ============================================ */

.progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.progress-overlay.show {
    display: flex;
}

.progress-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Mobile Enhancements
   ============================================ */

@media (max-width: 768px) {
    .smart-search-container {
        max-width: 100%;
        margin: 10px 0;
    }
    
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #ddd;
        display: flex;
        justify-content: space-around;
        padding: 10px 0;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        color: #666;
        text-decoration: none;
        font-size: 12px;
    }
    
    .bottom-nav a.active {
        color: var(--primary-color, #7424a9);
    }
}
