/**
 * LearnPress Course Search - Styles
 * File: assets/css/course-search.css
 */

/* Search Toggle Button */
.lp-search-toggle-btn {
    position: fixed;
    right: 30px;
    top: 20%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    pointer-events: auto !important;
}

.lp-search-toggle-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.lp-search-toggle-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.lp-search-toggle-btn svg {
    width: 24px;
    height: 24px;
    pointer-events: none;
}

/* Search Panel */
.lp-search-panel {
    position: fixed;
    right: -450px;
    top: 0;
    width: 420px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100000 !important;
    display: flex;
    flex-direction: column;
}

.lp-search-panel.open {
    right: 0;
}

/* Search Header */
.lp-search-header {
    padding: 30px 25px 20px;
   /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
   background: linear-gradient(135deg, #001d9d 0%, #000 100%);
    color: white;
}

.lp-search-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.lp-search-title {
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lp-search-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    outline: none;
}

.lp-search-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.lp-search-close-btn svg {
    pointer-events: none;
}

/* Search Input */
#lpSearchInput{
    color:#ffffff;
}

.lp-search-input-wrapper {
    position: relative;
}

.lp-search-input {
    width: 100%;
    padding: 15px 45px 15px 45px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.95);

    color: #ffffff;
    transition: all 0.3s ease;
    outline: none;
}

.lp-search-input:focus {
    outline: none;
    background: white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.lp-search-input::placeholder {
    color: #999;
}

.lp-search-icon {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.lp-search-clear-btn {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    background: #f0f0f0;
    border: none;
    color: #666;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    outline: none;
}

.lp-search-clear-btn.visible {
    display: flex;
}

.lp-search-clear-btn:hover {
    background: #e0e0e0;
}

.lp-search-clear-btn svg {
    pointer-events: none;
}

/* Search Results */
.lp-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px;
}

.lp-results-info {
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #667eea;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.lp-result-item {
    padding: 18px;
    margin-bottom: 12px;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
    text-decoration: none;
    display: block;
    color: inherit;
}

.lp-result-item:hover {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.lp-result-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.lp-result-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.lp-result-info {
    flex: 1;
}

.lp-result-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lp-result-type {
    font-size: 11px;
    padding: 3px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
}

.lp-result-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-top: 8px;
}

.lp-highlight {
    background: #fff59d;
    color: #333;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 3px;
}

.lp-match-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #667eea;
    margin-top: 8px;
    font-weight: 500;
}

.lp-match-count svg {
    width: 14px;
    height: 14px;
}

.lp-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.lp-no-results-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    opacity: 0.3;
}

.lp-no-results-text {
    font-size: 16px;
    margin-bottom: 10px;
}

.lp-no-results-hint {
    font-size: 14px;
    color: #bbb;
}

.lp-empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.lp-empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    opacity: 0.2;
}

.lp-loading {
    text-align: center;
    padding: 40px 20px;
    color: #667eea;
}

.lp-loading svg {
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Overlay */
.lp-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99998 !important;
}

.lp-search-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Scrollbar */
.lp-search-results::-webkit-scrollbar {
    width: 6px;
}

.lp-search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.lp-search-results::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.lp-search-results::-webkit-scrollbar-thumb:hover {
    background: #999;
}



/* =========================
   MOBILE PHONES (≤767px)
========================= */
@media (max-width: 767px) {

    /* Panel width */
    .lp-search-panel {
        width: 100%;
        right: -100%;
    }

    /* Toggle button */
    .lp-search-toggle-btn {
        top: 100px;       /* fixed pixel, avoids % issues */
        right: 6px;
        width: 46px;
        height: 46px;
        z-index: 9999;
    }
}

/* MOBILE LANDSCAPE */
@media (max-width: 767px) and (orientation: landscape) {

    .lp-search-panel {
        width: 85%;
        right: -85%;
    }

    .lp-search-toggle-btn {
        top: 60px;       /* adjust if needed for landscape */
    }
}

/* =========================
   TABLETS / iPad (768px - 1024px)
========================= */
@media (min-width: 768px) and (max-width: 1024px) {

    .lp-search-panel {
        width: 420px;    /* default for tablet landscape */
        right: -420px;
    }

    .lp-search-toggle-btn {
        width: 56px;
        height: 56px;
        top: 100px;      /* adjust to your layout */
        right: 8px;
    }
}

/* iPad Portrait only */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {

    .lp-search-panel {
        width: 100%;
        right: -100%;
    }

    .lp-search-toggle-btn {
        top: 90px;
    }
}

/* =========================
   SMALL DEVICES / iPhone (≤480px)
========================= */
@media (max-width: 480px) {
    .lp-search-toggle-btn {
        top: 100px;
        right: 6px;
        width: 46px;
        height: 46px;
        z-index: 9999;
    }
}
