/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #080c14;
    --card-bg: rgba(17, 25, 40, 0.5);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary-glow: rgba(99, 102, 241, 0.15);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent: #a855f7;
    --accent-glow: rgba(168, 85, 247, 0.15);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #6b7280;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.1) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(20, 30, 60, 0.6) 0px, transparent 70%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Glassmorphic Container */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: var(--transition);
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* App Shell */
.app-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header Section */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-section h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(to right, #ffffff, #9ca3af, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-section p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Privacy Shield Monitor UI */
.privacy-badge-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.privacy-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--success);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.05);
    animation: pulse 3s infinite;
}

.privacy-badge span.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.network-monitor-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.network-monitor-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
}

.network-monitor-btn.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--primary);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}

/* Privacy Shield Modal/Panel */
.privacy-monitor-panel {
    display: none;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    margin-bottom: 0.5rem;
    animation: slideDown 0.3s ease-out;
}

.privacy-monitor-panel.active {
    display: flex;
}

.monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
}

.monitor-header h3 {
    font-size: 1.1rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.monitor-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 0.5rem 0;
}

.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 1rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-card .label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stat-card .value {
    font-size: 1.4rem;
    font-weight: 700;
}

.stat-card .value.secure {
    color: var(--success);
}

.network-log {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    max-height: 150px;
    overflow-y: auto;
    color: #34d399;
}

.network-log-item {
    margin-bottom: 0.4rem;
    display: flex;
    gap: 1rem;
}

.network-log-item .time {
    color: var(--text-dark);
}

.network-log-item .msg {
    word-break: break-all;
}

/* Main Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 850px) {
    .dashboard-grid {
        grid-template-columns: 380px 1fr;
    }
}

/* Left Sidebar - Actions */
.sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-self: start;
}

/* Upload Section */
.upload-container {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.upload-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.01);
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.04);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.05);
}

.drop-zone svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    transition: var(--transition);
}

.drop-zone:hover svg, .drop-zone.dragover svg {
    color: var(--primary);
    transform: translateY(-4px);
}

.drop-zone-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.drop-zone-text strong {
    color: var(--text-main);
}

.drop-zone-subtext {
    font-size: 0.75rem;
    color: var(--text-dark);
}

/* File Active State */
.file-info-box {
    display: none;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    animation: fadeIn 0.4s ease-out;
}

.file-info-box.active {
    display: flex;
}

.file-icon {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 0.6rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-details {
    flex-grow: 1;
    overflow: hidden;
}

.file-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.btn-remove-file {
    background: transparent;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-remove-file:hover {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

/* Dropdown/Select Settings */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.custom-select, .custom-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.custom-select:focus, .custom-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

.custom-select option {
    background-color: #0b0f19;
    color: var(--text-main);
}

/* Search Form Section */
.search-container {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-search {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-search:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-search:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dark);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Loading/Spinner States */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner.active {
    display: inline-block;
}

/* Right Content Area - Results */
.results-panel {
    min-height: 400px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
}

/* Empty State / Welcome Screen */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    margin-top: 4rem;
    color: var(--text-muted);
    gap: 1.25rem;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--text-dark);
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
}

.empty-state p {
    font-size: 0.9rem;
    max-width: 320px;
}

/* Active Search Result header */
.results-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 1rem;
}

.results-header.active {
    display: flex;
}

.results-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-count-badge {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Search results Grid Layout */
.results-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Detail Card UI */
.result-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    transition: var(--transition);
    animation: fadeInUp 0.4s ease-out;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.result-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.result-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 0.75rem;
}

.result-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-card-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-card-action {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-card-action:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.15);
}

.result-fields-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem 1.5rem;
}

@media (min-width: 550px) {
    .result-fields-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.result-field {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    border-left: 3px solid rgba(255, 255, 255, 0.05);
}

.result-field.highlighted {
    border-left-color: var(--primary);
    background: rgba(99, 102, 241, 0.03);
}

.field-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.15rem;
    text-transform: capitalize;
}

.field-value {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 600;
    word-break: break-word;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #0f172a;
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--text-main);
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateY(150%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.toast.active {
    transform: translateY(0);
    opacity: 1;
}

.toast svg {
    color: var(--success);
}

/* Keyframe Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.05);
        border-color: rgba(16, 185, 129, 0.25);
    }
    50% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
        border-color: rgba(16, 185, 129, 0.5);
    }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Footer Section */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-dark);
    font-size: 0.8rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

footer a {
    color: var(--text-muted);
    text-decoration: none;
}

footer a:hover {
    color: var(--primary);
}
