/* =======================================================
 * eInvest Content Suite Pro — Live Search Styles
 * Style 1 (default) + Style 2 (hero)
 * Generat automat din LiveSearch.php
 * ======================================================= */

/* ===== STYLE 1 — DEFAULT ===== */
        /* ===== LIVE SEARCH - DESIGN FINAL ===== */
        
        /* Container principal - lățime 100% */
        .ecs-live-search {
            position: relative;
            width: 100%;
            max-width: 100%;
            margin: 2rem 0 1.5rem 0;
            font-family: 'Poppins', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
        }

        /* Input wrapper */
        .ecs-live-search-input-wrap {
            position: relative;
            display: flex;
            align-items: center;
            width: 100%;
        }

        /* Icon search în DREAPTA - mai aproape de margine */
        .ecs-live-search-icon {
            position: absolute;
            right: 0.5rem; /* Distanță egală cu distanța vizuală de sus/jos */
            top: 50%;
            transform: translateY(-50%);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            background: rgba(42, 218, 73, 0.12);
            border: 1px solid rgba(42, 218, 73, 0.3);
            border-radius: 8px;
            pointer-events: none;
            z-index: 2;
            transition: all 0.3s ease;
        }

        .ecs-live-search-icon svg {
            width: 15px;
            height: 15px;
            color: #2ada49;
            stroke: #2ada49;
            fill: none;
            transition: all 0.3s ease;
        }

        /* Input field - font-size mai mic pe desktop */
        .ecs-live-search-input {
            width: 100%;
            padding: 0.8rem 55px 0.8rem 1.25rem; /* extra padding dreapta pentru icon */
            border-radius: 12px;
            border: 1px solid rgba(255, 255, 255, 0.25);
            font-size: 15px; /* Mai mic pe desktop */
            line-height: 1.4;
            outline: none;
            background: rgba(255, 255, 255, 0.05);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            color: #ffffff;
            transition: all 0.3s ease;
            font-family: inherit;
            box-sizing: border-box;
        }

        .ecs-live-search-input::placeholder {
            color: rgba(255, 255, 255, 0.5);
        }

        .ecs-live-search-input:hover {
            border-color: rgba(255, 255, 255, 0.4);
            background: rgba(255, 255, 255, 0.08);
        }

        .ecs-live-search-input:focus {
            border-color: #2ada49;
            background: rgba(255, 255, 255, 0.08);
            box-shadow: 0 0 0 3px rgba(42, 218, 73, 0.15);
        }

        /* Icon animație la focus — doar style 1 */
        .ecs-live-search:not(.ecs-ls-s2) .ecs-live-search-input:focus ~ .ecs-live-search-icon {
            background: rgba(42, 218, 73, 0.2);
            border-color: #2ada49;
            transform: translateY(-50%) scale(1.05);
        }

        .ecs-live-search:not(.ecs-ls-s2) .ecs-live-search-input:focus ~ .ecs-live-search-icon svg {
            color: #3fef5c;
            stroke: #3fef5c;
        }

        /* Dropdown rezultate */
        .ecs-live-search-results {
            position: absolute;
            top: calc(100% + 12px);
            left: 0;
            right: 0;
            z-index: 9999;
            display: none;
        }

        .ecs-live-search-results.is-open {
            display: block;
            animation: ecs-slideDown 0.3s ease;
        }

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

        /* Lista rezultate */
        .ecs-live-search-list {
            max-height: 440px;
            overflow-y: auto;
            background: rgba(255, 255, 255, 0.04);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid rgba(255, 255, 255, 0.10);
            border-radius: 12px;
            padding: 6px;
            box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
            margin: 0;
            list-style: none;
        }

        /* Item rezultat individual */
        .ecs-live-search-item {
            display: flex;
            align-items: center;
            padding: 10px 12px;
            text-decoration: none;
            color: inherit;
            gap: 12px;
            cursor: pointer;
            transition: background 0.18s;
            border-radius: 8px;
            margin-bottom: 2px;
            background: transparent;
        }

        .ecs-live-search-item:last-child {
            margin-bottom: 0;
        }

        .ecs-live-search-item:hover,
        .ecs-live-search-item:focus {
            background: rgba(255, 255, 255, 0.06);
            transform: none;
            text-decoration: none;
        }

        /* Logo */
        .ecs-live-search-logo {
            flex-shrink: 0;
            width: 40px;
            height: 40px;
            border-radius: 8px;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.10);
            padding: 5px;
            box-sizing: border-box;
        }

        .ecs-live-search-logo img {
            max-width: 100%;
            max-height: 100%;
            display: block;
            object-fit: contain;
        }

        /* Placeholder când nu există logo */
        .ecs-live-search-logo--placeholder {
            background: rgba(42, 218, 73, 0.10);
            border: 1px solid rgba(42, 218, 73, 0.25);
        }

        .ecs-live-search-logo--placeholder span {
            font-size: 15px;
            font-weight: 700;
            color: #2ada49;
        }

        /* Secțiunea text */
        .ecs-live-search-main {
            display: flex;
            flex-direction: column;
            min-width: 0;
            flex: 1;
            gap: 3px;
        }

        /* Rând 1: Simbol + Badge */
        .ecs-live-search-row {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        /* Simbol activ (AAPL, BTC) */
        .ecs-live-search-symbol {
            font-weight: 700;
            font-size: 14px;
            color: #ffffff;
            letter-spacing: 0.01em;
        }

        /* Badge tip (Acțiuni, Crypto, ETF) */
        .ecs-live-search-type {
            font-size: 10px;
            font-weight: 600;
            padding: 2px 7px;
            border-radius: 5px;
            background: rgba(42, 218, 73, 0.10);
            border: 1px solid rgba(42, 218, 73, 0.25);
            color: #2ada49;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            line-height: 1;
            white-space: nowrap;
        }

        /* Rând 2: Nume | Separator | Țară · Exchange */
        .ecs-live-search-details {
            display: flex !important;
            flex-direction: row !important;
            align-items: center !important;
            gap: 8px;
            font-size: 12px;
            line-height: 1.3;
            flex-wrap: nowrap !important;
        }

        /* Nume companie */
        .ecs-live-search-name {
            color: rgba(255, 255, 255, 0.6);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex-shrink: 1;
            min-width: 0;
            display: inline !important;
        }

        /* Bară separatoare verticală */
        .ecs-live-search-separator {
            width: 1px;
            height: 11px;
            background: rgba(255, 255, 255, 0.15);
            flex-shrink: 0;
            display: inline-block !important;
        }

        /* Meta info (țară · bursă) */
        .ecs-live-search-meta {
            font-size: 11px;
            color: rgba(255, 255, 255, 0.35);
            white-space: nowrap;
            flex-shrink: 0;
            display: inline !important;
        }

        /* Empty state */
        .ecs-live-search-empty {
            padding: 16px;
            text-align: center;
            font-size: 13px;
            color: rgba(255, 255, 255, 0.5);
            line-height: 1.5;
        }

        /* Scrollbar */
        .ecs-live-search-list::-webkit-scrollbar {
            width: 4px;
        }

        .ecs-live-search-list::-webkit-scrollbar-track {
            background: transparent;
        }

        .ecs-live-search-list::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.15);
            border-radius: 4px;
        }

        .ecs-live-search-list::-webkit-scrollbar-thumb:hover {
            background: rgba(42, 218, 73, 0.5);
        }

        /* ===== RESPONSIVE ===== */
        
        @media (max-width: 768px) {
            .ecs-live-search {
                margin: 1.5rem 0 1rem 0;
            }

            .ecs-live-search-input {
                font-size: 16px;
                padding: 0.75rem 48px 0.75rem 1rem;
            }

            .ecs-live-search-icon {
                width: 30px;
                height: 30px;
                right: 0.5rem;
            }

            .ecs-live-search-icon svg {
                width: 14px;
                height: 14px;
            }

            .ecs-live-search-list {
                max-height: 380px;
            }

            .ecs-live-search-logo {
                width: 36px;
                height: 36px;
            }

            .ecs-live-search-item {
                padding: 8px 10px;
                gap: 10px;
            }
        }

        @media (max-width: 480px) {
            .ecs-live-search-input {
                font-size: 16px;
                padding: 0.7rem 45px 0.7rem 0.9rem;
            }

            .ecs-live-search-icon {
                width: 28px;
                height: 28px;
                right: 0.5rem;
            }

            .ecs-live-search-icon svg {
                width: 13px;
                height: 13px;
            }

            .ecs-live-search-list {
                max-height: 320px;
            }

            .ecs-live-search-logo {
                width: 34px;
                height: 34px;
            }

            .ecs-live-search-item {
                padding: 7px 8px;
                gap: 8px;
            }
        }

        /* Previne zoom pe input în Safari iOS */
        @supports (-webkit-touch-callout: none) {
            .ecs-live-search-input {
                font-size: 16px !important;
            }
        }

/* ===== STYLE 2 — HERO ===== */
        /* ===== LIVE SEARCH STYLE 2 — HERO ===== */

        .ecs-live-search.ecs-ls-s2 {
            position: relative;
            width: 100%;
            font-family: 'Poppins', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
            margin: 0;
        }

        /* Wrapper — identic cu hero-search-box */
        .ecs-ls-s2 .ecs-live-search-input-wrap {
            position: relative;
            display: flex;
            align-items: center;
            background: rgba(255,255,255,.07);
            border: 1px solid rgba(255,255,255,.18);
            border-radius: 12px;
            overflow: hidden;
            transition: border-color .2s, box-shadow .2s;
        }

        .ecs-ls-s2 .ecs-live-search-input-wrap:focus-within {
            border-color: rgba(42,218,73,.4);
            box-shadow: 0 0 0 3px rgba(42,218,73,.08);
        }

        /* Input transparent integrat în wrapper */
        .ecs-ls-s2 .ecs-live-search-input {
            flex: 1;
            padding: 18px 52px 18px 18px;
            background: transparent;
            border: none;
            outline: none;
            font-family: 'Poppins', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
            font-size: 15px;
            color: #ffffff;
            line-height: 1.5;
            box-shadow: none;
            border-radius: 0;
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
            width: 100%;
            box-sizing: border-box;
        }

        .ecs-ls-s2 .ecs-live-search-input::placeholder {
            color: rgba(255,255,255,.4);
        }

        .ecs-ls-s2 .ecs-live-search-input:hover,
        .ecs-ls-s2 .ecs-live-search-input:focus {
            background: transparent;
            border: none;
            box-shadow: none;
        }

        /* Icon dreapta — simplu, fără background */
        .ecs-ls-s2 .ecs-live-search-icon {
            position: absolute;
            right: 16px;
            top: 50%;
            transform: translateY(-50%);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            pointer-events: none;
            z-index: 2;
            background: none;
            border: none;
            width: auto;
            height: auto;
        }

        .ecs-ls-s2 .ecs-live-search-icon svg {
            width: 17px;
            height: 17px;
            stroke: rgba(255,255,255,.4);
            fill: none;
            transition: stroke .2s;
        }

        .ecs-ls-s2 .ecs-live-search-input-wrap:focus-within .ecs-live-search-icon svg {
            stroke: #2ada49;
        }

        /* Dropdown rezultate */
        .ecs-ls-s2 .ecs-live-search-results {
            position: absolute;
            top: calc(100% + 8px);
            left: 0;
            right: 0;
            z-index: 9999;
            display: none;
        }

        .ecs-ls-s2 .ecs-live-search-results.is-open {
            display: block;
            animation: ecs-s2-slide .22s ease;
        }

        @keyframes ecs-s2-slide {
            from { opacity: 0; transform: translateY(-6px); }
            to   { opacity: 1; transform: translateY(0); }
        }

        /* Lista dropdown */
        .ecs-ls-s2 .ecs-live-search-list {
            background: rgba(255,255,255,.07);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid rgba(255,255,255,.18);
            border-radius: 12px;
            padding: 6px;
            box-shadow: 0 20px 48px rgba(0,0,0,.5);
            max-height: 440px;
            overflow-y: auto;
            margin: 0;
            list-style: none;
        }

        /* Item */
        .ecs-ls-s2 .ecs-live-search-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 12px;
            border-radius: 8px;
            text-decoration: none;
            color: inherit;
            cursor: pointer;
            transition: background .18s;
            margin-bottom: 2px;
        }

        .ecs-ls-s2 .ecs-live-search-item:last-child { margin-bottom: 0; }

        .ecs-ls-s2 .ecs-live-search-item:hover,
        .ecs-ls-s2 .ecs-live-search-item:focus {
            background: rgba(255,255,255,.08);
            text-decoration: none;
            transform: none;
        }

        /* Logo */
        .ecs-ls-s2 .ecs-live-search-logo {
            flex-shrink: 0;
            width: 40px;
            height: 40px;
            border-radius: 8px;
            overflow: hidden;
            background: rgba(255,255,255,.08);
            border: 1px solid rgba(255,255,255,.12);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 5px;
            box-sizing: border-box;
        }

        .ecs-ls-s2 .ecs-live-search-logo img {
            max-width: 100%;
            max-height: 100%;
            display: block;
            object-fit: contain;
        }

        .ecs-ls-s2 .ecs-live-search-logo--placeholder {
            background: rgba(42,218,73,.1);
            border-color: rgba(42,218,73,.25);
        }

        .ecs-ls-s2 .ecs-live-search-logo--placeholder span {
            font-size: 15px;
            font-weight: 700;
            color: #2ada49;
        }

        /* Text main */
        .ecs-ls-s2 .ecs-live-search-main {
            display: flex;
            flex-direction: column;
            min-width: 0;
            flex: 1;
            gap: 3px;
            font-family: 'Poppins', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
        }

        .ecs-ls-s2 .ecs-live-search-row {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .ecs-ls-s2 .ecs-live-search-symbol {
            font-size: 14px;
            font-weight: 700;
            color: #ffffff;
            letter-spacing: .01em;
        }

        .ecs-ls-s2 .ecs-live-search-type {
            font-size: 10px;
            font-weight: 600;
            padding: 2px 7px;
            border-radius: 5px;
            background: rgba(42,218,73,.12);
            border: 1px solid rgba(42,218,73,.3);
            color: #2ada49;
            text-transform: uppercase;
            letter-spacing: .05em;
            line-height: 1;
            white-space: nowrap;
        }

        .ecs-ls-s2 .ecs-live-search-details {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            flex-wrap: nowrap;
        }

        .ecs-ls-s2 .ecs-live-search-name {
            color: rgba(255,255,255,.6);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex-shrink: 1;
            min-width: 0;
        }

        .ecs-ls-s2 .ecs-live-search-separator {
            width: 1px;
            height: 11px;
            background: rgba(255,255,255,.2);
            flex-shrink: 0;
        }

        .ecs-ls-s2 .ecs-live-search-meta {
            font-size: 11px;
            color: rgba(255,255,255,.35);
            white-space: nowrap;
            flex-shrink: 0;
        }

        /* Empty state */
        .ecs-ls-s2 .ecs-live-search-empty {
            padding: 16px;
            text-align: center;
            font-size: 13px;
            color: rgba(255,255,255,.5);
            font-family: 'Poppins', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
        }

        /* Scrollbar */
        .ecs-ls-s2 .ecs-live-search-list::-webkit-scrollbar { width: 4px; }
        .ecs-ls-s2 .ecs-live-search-list::-webkit-scrollbar-track { background: transparent; }
        .ecs-ls-s2 .ecs-live-search-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
        .ecs-ls-s2 .ecs-live-search-list::-webkit-scrollbar-thumb:hover { background: rgba(42,218,73,.5); }

        /* Responsive */
        @media (max-width: 768px) {
            .ecs-ls-s2 .ecs-live-search-input { padding: 16px 48px 16px 16px; }
        }

        @media (max-width: 480px) {
            .ecs-ls-s2 .ecs-live-search-input { padding: 15px 46px 15px 14px; }
        }

        @supports (-webkit-touch-callout: none) {
            .ecs-ls-s2 .ecs-live-search-input { font-size: 16px !important; }
        }
