.search-wrapper {
    position: relative;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 180px;
    height: 40px;
    padding: 5px 5px 5px 0px;
    gap: .5em;
    border: 1px solid #c2c6d2;
    border-radius: 30px;
    background-color: rgba(194, 198, 210, 0.5);
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-wrapper:focus-within {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.search-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 30px;
    padding: 10px;
    width: 50px;
    height: 40px;
    background-color: #1c1c1c;
    position: relative;
    z-index: 2;
}

.search-icon::after {
    content: '';
    width: 20px;
    height: 20px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="white"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/></svg>') no-repeat center;
    background-size: contain;
}

.search-input {
    flex-grow: 1;
    height: 100%;
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    padding: 0 40px 0 12px;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: -0.04em;
    color: #585b64;
}

.search-input::placeholder {
    color: #999;
}

.search-shortcut {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #999;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    pointer-events: none;
    opacity: 0.7;
    font-weight: 400;
}

.mobile-search-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 8px;
}

.mobile-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    z-index: 2;
}

.mobile-search-icon::after {
    content: '';
    width: 20px;
    height: 20px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="%23666"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/></svg>') no-repeat center;
    background-size: contain;
}

.mobile-search-input {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 45px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background-color: #f8f9fa;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-family);
    color: #1c1c1c;
    outline: none;
    transition: all 0.2s ease;
}

.mobile-search-input:focus {
    border-color: #e41d2f;
    background-color: rgba(228, 29, 47, 0.05);
}

.mobile-search-input::placeholder {
    color: #999;
}

.search-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.search-popup.active {
    display: flex;
    opacity: 1;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8vh;
}

.search-popup__content {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    transform: translateY(-30px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin: 0 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
}

.search-popup.active .search-popup__content {
    transform: translateY(0) scale(1);
}

.search-popup__header {
    padding: 24px 24px 20px;
    border-bottom: 1px solid rgba(185, 195, 206, 0.4);
    position: relative;
}

.search-popup__input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 24px;
    font-weight: 600;
    font-family: var(--font-family);
    padding: 8px 50px 8px 0;
    background: transparent;
    color: #000;
    letter-spacing: -0.04em;
}

.search-popup__input::placeholder {
    color: #999;
    font-weight: 400;
}

.search-popup__close {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-family: var(--font-family);
}

.search-popup__close:hover {
    background-color: #f5f5f5;
    color: #333;
}

.search-popup__body {
    max-height: 60vh;
    overflow-y: auto;
    padding: 0;
}

.search-popup__section {
    padding: 20px 24px;
}

.search-popup__section:not(:last-child) {
    border-bottom: 1px solid rgba(185, 195, 206, 0.4);
}

.search-popup__section-title {
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-family);
    color: #666;
    text-transform: uppercase;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

.search-popup__results {
    display: grid;
    gap: 4px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    position: relative;
}

.search-result-item:hover {
    background-color: #f8f9fa;
    color: inherit;
    text-decoration: none;
    transform: translateX(4px);
}

.search-result-item.active {
    background-color: #e3f2fd;
    transform: translateX(4px);
}

.search-result-item__image {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    background-color: #f5f5f5;
    flex-shrink: 0;
}

.search-result-item__content {
    flex: 1;
    min-width: 0;
}

.search-result-item__title {
    font-weight: 600;
    font-size: 16px;
    font-family: var(--font-family);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #000;
    letter-spacing: -0.04em;
}

.search-result-item__meta {
    font-size: 14px;
    color: #666;
    margin: 0;
    font-family: var(--font-family);
    font-weight: 500;
    letter-spacing: -0.04em;
}

.search-result-item__badge {
    background: linear-gradient(135deg, #e41d2f, #dc3545);
    color: white;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-family: var(--font-family);
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.search-popup__empty,
.search-popup__loading {
    text-align: center;
    padding: 60px 24px;
    color: #666;
}

.search-popup__empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.search-popup__empty h6 {
    font-size: 18px;
    font-weight: 600;
    font-family: var(--font-family);
    margin-bottom: 8px;
    color: #000;
    letter-spacing: -0.04em;
}

.search-popup__empty p {
    font-family: var(--font-family);
    font-weight: 500;
    letter-spacing: -0.04em;
}

.search-popup__spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #e41d2f;
    border-radius: 50%;
    animation: search-spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes search-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-popup__loading p {
    margin-top: 16px;
    font-family: var(--font-family);
    font-weight: 500;
    letter-spacing: -0.04em;
}

@media (max-width: 1099px) { 
    .search-wrapper {
        max-width: none;
    }
}

@media (max-width: 768px) {
    .search-wrapper {
        max-width: none;
    }

    .search-input {
        font-size: 14px;
        padding-right: 35px;
    }

    .search-shortcut {
        display: none !important;
    }

    .search-popup.active {
        padding-top: 2vh;
    }

    .search-popup__content {
        max-height: 95vh;
        border-radius: 20px 20px 0 0;
        margin: 0;
    }

    .search-popup__header {
        padding: 20px 16px 16px;
    }

    .search-popup__input {
        font-size: 20px;
        padding-right: 50px;
    }

    .search-popup__section {
        padding: 16px;
    }

    .search-result-item__image {
        width: 48px;
        height: 48px;
    }

    .search-result-item__title {
        font-size: 15px;
    }

    .search-result-item__meta {
        font-size: 13px;
    }

    .search-result-item {
        gap: 12px;
        padding: 10px;
    }
}

@media (max-width: 991px) {
    .search-wrapper {
        max-width: none;
    }
}

@media (max-width: 576px) {
    .search-wrapper {
        max-width: none;
    }
    
    .search-input {
        font-size: 13px;
    }
}

.search-popup__content .search-popup__section-title:first-child {
    margin-top: 0;
}

.search-result-item:first-child {
    margin-top: 0;
}

.search-result-item:last-child {
    margin-bottom: 0;
}

.search-result-item:hover .search-result-item__title {
    color: #e41d2f;
}

.search-popup__body::-webkit-scrollbar {
    width: 6px;
}

.search-popup__body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.search-popup__body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.search-popup__body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}