/* AI Magic Search Container */
.tk-magic-search-wrapper {
    margin: 20px 0 0 0;
    width: 100%;
    position: relative;
    z-index: 10;
    font-family: inherit;
}

.tk-magic-search-inner {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.tk-magic-search-inner:focus-within {
    box-shadow: 0 8px 30px rgba(0, 86, 179, 0.15), 0 0 0 2px #007bff;
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.95);
}

/* Magic Icon Element */
.tk-magic-search-inner .tk-magic-icon {
    font-size: 22px;
    color: #007bff;
    padding: 0px 18px;
    line-height: 1 !important;
    animation: tk-magic-pulse 2.5s infinite ease-in-out;
}

/* Stunning Input */
input.tk-magic-search-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    /*padding: 4px 4px 4px 0px !important;*/
    font-size: 16px;
    color: #333;
    outline: none !important;
    box-shadow: none !important;
    font-weight: 500;
}

input.tk-magic-search-input::placeholder {
    color: #888;
    font-style: italic;
    opacity: 0.7;
    padding-left: 20px;
}

/* Micro Animations */
@keyframes tk-magic-pulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(0,123,255,0.4)); color: #007bff; }
    50% { transform: scale(1.15); filter: drop-shadow(0 0 8px rgba(0,123,255,0.8)); color: #004ecc; }
    100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(0,123,255,0.4)); color: #007bff; }
}

/* Loading Spinner */
.tk-magic-spinner {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    border: 3px solid rgba(0, 123, 255, 0.2);
    border-top-color: #007bff;
    border-radius: 50%;
    animation: tk-magic-spin 0.8s linear infinite;
}

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

/* Results Dropdown */
.tk-magic-search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0,0,0,0.08);
    padding: 15px 20px;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    animation: tk-magic-fade-in 0.3s forwards cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tk-magic-search-results.tk-show {
    display: block;
}

@keyframes tk-magic-fade-in {
    to { opacity: 1; transform: translateY(0); }
}

.tk-magic-results-success {
    color: #155724;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tk-magic-results-error {
    color: #721c24;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Force hide events dynamically in FullCalendar */
.tk-ai-hidden {
    display: none !important;
}

/* Adapt for dark theme headers if necessary inside wp-admin */
body.wp-admin .tk-magic-search-wrapper {
    margin-top: 15px;
    max-width: 800px;
}

.tk-magic-toolbar-flex { display: flex; gap: 15px; align-items: stretch; } 
.tk-magic-search-inner { flex: 1; } 
.tk-magic-admin-links { display: flex; gap: 10px; align-items: stretch; }
.tk-magic-admin-btn { height: 38px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: 8px; font-weight: 500; font-size: 14px; text-decoration: none; color: #fff; background: rgba(67, 74, 81, 0.8); backdrop-filter: blur(5px); box-shadow: 0 4px 15px rgba(0,0,0,0.1); transition: all 0.2s ease; border: 1px solid rgba(255,255,255,0.1); }
.tk-magic-admin-btn:hover { background: #007bff; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,123,255,0.25); color: #fff; }
@media (max-width: 768px) { .tk-magic-toolbar-flex { flex-direction: column; } .tk-magic-admin-links { flex-wrap: wrap; } .tk-magic-admin-btn { flex: 1; padding: 10px; height: auto; } }
