/* === OSINT Toolkit - CSS Variables (solarized-osaka-night) === */
:root {
    --bg-main: #0b1720;
    --bg-panel: #001f2a;
    --bg-panel-soft: #022737;
    --bg-input: #011a23;
    --fg-primary: #e5f2f7;
    --fg-muted: #8fa1ad;
    --fg-accent: #b3ecff;
    --accent-cyan: #2aa198;
    --accent-blue: #268bd2;
    --accent-magenta: #d33682;
    --accent-yellow: #b58900;
    --accent-orange: #cb4b16;
    --accent-green: #859900;
    --accent-red: #dc322f;
    --border-subtle: #123345;
    --border-focus: #2aa198;
    --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.55);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --font-mono: "Fira Code", "Courier New", monospace;
    --font-sans: system-ui, -apple-system, sans-serif;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--fg-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

.vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 0%, transparent 50%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 0;
}

/* === Navigation === */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--bg-panel) 0%, var(--bg-panel-soft) 100%);
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
}

.nav-back {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-cyan);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.nav-back:hover {
    background: var(--bg-panel-soft);
    color: var(--fg-accent);
}

.nav-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--fg-primary);
}

.nav-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-cyan);
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--fg-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-btn:hover {
    background: var(--bg-panel-soft);
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

/* === Container === */
.container {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 24px 80px;
    z-index: 1;
}

/* === Hero === */
.hero {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.hero h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-family: var(--font-mono);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 600;
    color: var(--fg-primary);
    margin-bottom: 10px;
}

.hero-icon {
    width: 36px;
    height: 36px;
    color: var(--accent-cyan);
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--fg-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* === Tabs === */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    padding: 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--fg-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--fg-primary);
    background: var(--bg-panel-soft);
}

.tab.active {
    color: var(--bg-main);
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.tab svg {
    flex-shrink: 0;
}

/* === Tab Content === */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* === Panels === */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-cyan);
    margin-bottom: 8px;
}

.panel-title svg {
    flex-shrink: 0;
}

.panel-desc {
    color: var(--fg-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* === Quick Search === */
.quick-search-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .quick-search-grid {
        grid-template-columns: 1fr;
    }
}

.search-card {
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
}

.search-card label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--fg-muted);
    margin-bottom: 10px;
}

.search-card input {
    width: 100%;
    padding: 14px 16px;
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--fg-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all var(--transition-fast);
}

.search-card input::placeholder {
    color: var(--fg-muted);
}

.search-card input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(42, 161, 152, 0.2);
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.type-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--fg-muted);
}

.type-badge.active {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.type-badge[data-type="email"] { border-color: var(--accent-blue); color: var(--accent-blue); }
.type-badge[data-type="domain"] { border-color: var(--accent-green); color: var(--accent-green); }
.type-badge[data-type="ip"] { border-color: var(--accent-orange); color: var(--accent-orange); }
.type-badge[data-type="username"] { border-color: var(--accent-magenta); color: var(--accent-magenta); }
.type-badge[data-type="name"] { border-color: var(--accent-yellow); color: var(--accent-yellow); }

/* === Search Results Grid === */
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.results-placeholder {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--fg-muted);
    text-align: center;
}

.results-placeholder svg {
    opacity: 0.4;
    margin-bottom: 16px;
}

.result-category {
    grid-column: 1 / -1;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-cyan);
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-top: 16px;
}

.result-category:first-child {
    margin-top: 0;
}

.result-item {
    display: block;
    padding: 14px 16px;
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.result-item:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.result-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--fg-primary);
    margin-bottom: 4px;
}

.result-item-url {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-blue);
    word-break: break-all;
}

.result-item-info {
    font-size: 0.8rem;
    color: var(--fg-muted);
    margin-top: 6px;
}

/* === Dork Builder === */
.dork-builder-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .dork-builder-grid {
        grid-template-columns: 1fr;
    }
}

.dork-inputs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 600px) {
    .dork-inputs {
        grid-template-columns: 1fr;
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group.full-width {
    grid-column: 1 / -1;
}

.input-group label {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-cyan);
}

.input-group input,
.input-group select {
    padding: 10px 12px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--fg-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all var(--transition-fast);
}

.input-group input::placeholder {
    color: var(--fg-muted);
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px rgba(42, 161, 152, 0.15);
}

.input-group select {
    cursor: pointer;
}

.input-hint {
    font-size: 0.75rem;
    color: var(--fg-muted);
}

.dork-output {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dork-output label {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--fg-muted);
}

.dork-preview {
    flex: 1;
    padding: 20px;
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    min-height: 150px;
}

.dork-preview code {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--accent-yellow);
    word-break: break-all;
    white-space: pre-wrap;
}

.dork-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* === Dork Library === */
.library-filters {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.library-search {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--fg-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all var(--transition-fast);
}

.library-search::placeholder {
    color: var(--fg-muted);
}

.library-search:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(42, 161, 152, 0.2);
}

.library-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cat-btn {
    padding: 8px 14px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--fg-muted);
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.cat-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--fg-primary);
}

.cat-btn.active {
    background: var(--accent-cyan);
    color: var(--bg-main);
    border-color: var(--accent-cyan);
}

.dork-library-grid {
    display: grid;
    gap: 12px;
}

.dork-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.dork-item:hover {
    border-color: var(--accent-cyan);
}

.dork-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.dork-item-query {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-yellow);
    word-break: break-all;
}

.dork-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.dork-item-desc {
    font-size: 0.8rem;
    color: var(--fg-muted);
}

.dork-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dork-tag {
    padding: 3px 8px;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    background: var(--bg-main);
    color: var(--fg-muted);
    border-radius: 3px;
}

/* === Full Recon === */
.recon-form {
    margin-bottom: 24px;
}

.recon-inputs {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.recon-fieldset {
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
}

.recon-fieldset legend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-cyan);
    padding: 0 8px;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.field label {
    display: block;
    font-size: 0.8rem;
    color: var(--fg-muted);
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    padding: 10px 12px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--fg-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all var(--transition-fast);
}

.field input::placeholder {
    color: var(--fg-muted);
}

.field input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px rgba(42, 161, 152, 0.15);
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.module-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.module-check:hover {
    border-color: var(--accent-cyan);
}

.module-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-cyan);
    cursor: pointer;
}

.module-check span {
    font-size: 0.85rem;
    color: var(--fg-primary);
}

.recon-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.recon-results {
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px;
    min-height: 200px;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn svg {
    flex-shrink: 0;
}

.btn-primary {
    background: var(--accent-cyan);
    color: var(--bg-main);
}

.btn-primary:hover {
    background: #35b5a8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-panel-soft);
    color: var(--fg-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: var(--bg-panel);
    border-color: var(--accent-cyan);
}

.btn-ghost {
    background: transparent;
    color: var(--fg-muted);
    padding: 8px 12px;
}

.btn-ghost:hover {
    color: var(--accent-cyan);
    background: var(--bg-panel-soft);
}

.btn-small {
    padding: 6px 10px;
    font-size: 0.75rem;
}

.btn-large {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-danger {
    background: rgba(220, 50, 47, 0.15);
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
}

.btn-danger:hover {
    background: var(--accent-red);
    color: var(--fg-primary);
}

/* === Modal === */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal:not([hidden]) {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--fg-primary);
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--fg-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-panel-soft);
    color: var(--accent-red);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
}

.settings-info {
    font-size: 0.85rem;
    color: var(--fg-muted);
    margin-bottom: 20px;
    padding: 12px;
    background: var(--bg-panel-soft);
    border-radius: var(--radius-sm);
}

.api-keys-grid {
    display: grid;
    gap: 16px;
}

.api-key-field label {
    display: block;
    font-size: 0.85rem;
    color: var(--fg-muted);
    margin-bottom: 6px;
}

.api-key-field input {
    width: 100%;
    padding: 10px 12px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--fg-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all var(--transition-fast);
}

.api-key-field input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px rgba(42, 161, 152, 0.15);
}

/* === Toast === */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 24px;
    background: var(--bg-panel);
    border: 1px solid var(--accent-cyan);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    color: var(--fg-primary);
    font-size: 0.9rem;
    z-index: 1100;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast:not([hidden]) {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    border-color: var(--accent-red);
}

.toast.success {
    border-color: var(--accent-green);
}

/* === Footer === */
.footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    color: var(--fg-muted);
    font-size: 0.85rem;
}

.footer-divider {
    color: var(--border-subtle);
}

/* === Responsive === */
@media (max-width: 768px) {
    .top-nav {
        padding: 10px 16px;
    }
    
    .nav-title {
        font-size: 0.9rem;
    }
    
    .container {
        padding: 20px 16px 60px;
    }
    
    .hero h1 {
        font-size: 1.3rem;
    }
    
    .tabs {
        padding: 8px;
    }
    
    .tab {
        padding: 10px 14px;
        font-size: 0.8rem;
    }
    
    .tab span {
        display: none;
    }
    
    .panel {
        padding: 16px;
    }
    
    .panel-title {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .nav-back span {
        display: none;
    }
    
    .nav-back {
        padding: 8px;
    }
}

/* === Loading States === */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(11, 23, 32, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-subtle);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* === Selection === */
::selection {
    background: var(--accent-cyan);
    color: var(--bg-main);
}
