/**
 * Sinkori Network V2 - Overlays (Drawers, Modals, Dropdowns)
 */

/* --- Search Dropdown --- */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    display: none;
    z-index: 100;
    overflow: hidden;
}

.search-dropdown.active { display: block; }

.search-group { border-bottom: 1px solid var(--border); }
.search-group:last-child { border-bottom: none; }

.search-group-title {
    padding: 0.75rem 1rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    background: rgba(0,0,0,0.3);
    letter-spacing: 1px;
}

.search-item {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.search-item:hover { background: var(--surface-hover); }

.search-item-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.2;
}

/* --- Deep Data Drawer (Tabbed) --- */
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 500px;
    height: 100vh;
    background: var(--surface-solid);
    border-left: 1px solid var(--border);
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -15px 0 40px rgba(0,0,0,0.6);
}

.drawer.open { transform: translateX(0); }

.drawer-header {
    padding: 2rem 2rem 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.drawer-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Drawer Tabs */
.drawer-tabs {
    display: flex;
    padding: 0 2rem;
    margin-top: 1.5rem;
    border-bottom: 1px solid var(--border);
    gap: 1.5rem;
}

.tab {
    padding: 0.75rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab:hover { color: white; }
.tab.active {
    color: var(--primary-glow);
    border-bottom-color: var(--primary-glow);
}

.drawer-content {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Modals & Overlays --- */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal-backdrop.active { display: flex; }

.modal-container {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 90vh;
}

.modal-container.large {
    max-width: 1000px;
    height: 90vh;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: rgba(0,0,0,0.2);
}

/* Form Elements for Modal */
.form-group { margin-bottom: 1.5rem; }
.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: white;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-glow);
}

/* --- Comparison Split Screen Modal --- */
.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding-bottom: 2rem;
}

.compare-side {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}