/**
 * AAK Search - Modern Light Mode Styles
 *
 * @package AAK_Search
 */

/* Force Light Mode - No dark mode switching */
.aak-search-container,
.aak-search-container * {
    --aak-primary: #d11218;
    --aak-primary-hover: #b00f14;
    --aak-background: #ffffff;
    --aak-background-hover: #f8fafc;
    --aak-border: #e2e8f0;
    --aak-text: #1e293b;
    --aak-text-muted: #64748b;
    --aak-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --aak-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --aak-radius: 8px;
    --aak-transition: all 0.2s ease;
}

/* Container */
.aak-search-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
}

/* Compact variant for menu */
.aak-search-container.aak-compact {
    max-width: 280px;
}

.aak-search-container.aak-compact .aak-search-input {
    padding: 10px 40px 10px 38px;
    font-size: 14px;
    border-radius: 6px;
}

.aak-search-container.aak-compact .aak-search-icon {
    left: 12px;
    width: 16px;
    height: 16px;
}

.aak-search-container.aak-compact .aak-search-loading {
    right: 12px;
    width: 16px;
    height: 16px;
}

.aak-search-container.aak-compact .aak-search-results {
    min-width: 320px;
    right: auto;
}

/* Input Wrapper */
.aak-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* Search Icon */
.aak-search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: #64748b;
    pointer-events: none;
    z-index: 2;
}

/* Input Field - White Background */
.aak-search-input {
    width: 100%;
    padding: 12px 44px 12px 44px;
    font-size: 15px;
    color: #1e293b;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--aak-radius);
    outline: none;
    transition: var(--aak-transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.aak-search-input::placeholder {
    color: #94a3b8;
}

.aak-search-input:hover {
    border-color: #cbd5e1;
}

.aak-search-input:focus {
    border-color: #d11218;
    box-shadow: 0 0 0 3px rgba(209, 18, 24, 0.12);
}

/* Loading Spinner */
.aak-search-loading {
    position: absolute;
    right: 14px;
    display: none;
    width: 18px;
    height: 18px;
    color: #d11218;
}

.aak-search-loading.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.aak-spinner {
    width: 100%;
    height: 100%;
    animation: aak-spin 0.8s linear infinite;
}

@keyframes aak-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Results Dropdown */
.aak-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 380px;
    overflow-y: auto;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--aak-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    z-index: 99999;
    display: none;
}

.aak-search-results.active {
    display: block;
    animation: aak-fade-in 0.15s ease;
}

@keyframes aak-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Result Item */
.aak-result-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    text-decoration: none;
    color: #1e293b;
    background-color: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease;
}

.aak-result-item:last-child {
    border-bottom: none;
}

.aak-result-item:hover,
.aak-result-item.active {
    background-color: #f8fafc;
}

/* Result Header */
.aak-result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Result Title */
.aak-result-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    line-height: 1.4;
}

.aak-result-title mark {
    background-color: rgba(209, 18, 24, 0.1);
    color: #d11218;
    padding: 0 2px;
    border-radius: 2px;
}

.aak-result-item:hover .aak-result-title {
    color: #d11218;
}

/* Post Type Badge */
.aak-result-type {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 3px;
    flex-shrink: 0;
}

.aak-result-type--post { background-color: #fee2e2; color: #b91c1c; }
.aak-result-type--page { background-color: #f3e8ff; color: #7c3aed; }

/* Result Excerpt */
.aak-result-excerpt {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

/* No Results State */
.aak-no-results, .aak-min-chars {
    padding: 24px 16px;
    text-align: center;
    background-color: #ffffff;
    color: #64748b;
}

/* ================================================
   AAK TOPBAR STYLES
   ================================================ */

.aak-topbar-search {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.aak-topbar-search-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
}

.aak-topbar-search-form {
    display: none;
    align-items: center;
    height: 45px;
    padding: 0 8px;
}

.aak-topbar-search.expanded .aak-topbar-search-form {
    display: flex;
}

.aak-topbar-search.expanded .aak-topbar-search-trigger {
    display: none;
}

.aak-topbar-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 4px;
    height: 32px;
    width: 280px;
}

.aak-topbar-search-input {
    width: 100%;
    height: 100%;
    padding: 0 32px 0 12px;
    font-size: 14px;
    border: none;
    background: transparent;
    outline: none;
}

.aak-topbar-search-close {
    position: absolute;
    right: 2px;
    color: #64748b;
    cursor: pointer;
    background: transparent;
    border: none;
}

.aak-topbar-search-results {
    position: fixed;
    top: 45px;
    right: 20px;
    width: 380px;
    max-height: 400px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    display: none;
}

.aak-topbar-search-results.active { display: block; }
