/* PrivaTools - Modern Dark-Mode-First Design System */
:root {
    --bg-primary: #09090b;
    --bg-secondary: #121215;
    --bg-card: #18181b;
    --bg-card-hover: #212124;
    --border-color: #27272a;
    --border-hover: #3f3f46;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent-indigo: #6366f1;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-subtle: 0 4px 24px -1px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px -5px rgba(99, 102, 241, 0.25);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Header & Navbar */
header {
    background: rgba(18, 18, 21, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.search-trigger {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.45rem 1rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 240px;
}

.search-trigger:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.kbd {
    background: #27272a;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid #3f3f46;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3.5rem 1.5rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 9999px;
    color: #818cf8;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
}

.hero h1 {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Category Filter Tabs */
.tabs-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    padding: 0 1rem;
}

.tab-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1.15rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.tab-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.tab-btn.active {
    background: #27272a;
    border-color: var(--accent-indigo);
    color: #fff;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

/* Cards Grid */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
    width: 100%;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 1.25rem;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-indigo), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.tool-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-subtle);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.tool-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: #27272a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.tool-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-wasm {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-php {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-hot {
    background: rgba(244, 63, 94, 0.15);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.tool-body h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #fff;
}

.tool-body p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.45;
}

.tool-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--accent-indigo);
    font-size: 0.875rem;
    font-weight: 600;
}

.tool-card:hover .tool-link {
    color: #818cf8;
}

/* Tool View Container */
.tool-view-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.25rem;
    max-width: 960px;
    margin: 1.5rem auto 4rem;
    box-shadow: var(--shadow-subtle);
}

.tool-view-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.tool-view-title h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.35rem;
}

.tool-view-title p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3.5rem 1.5rem;
    text-align: center;
    background: rgba(24, 24, 27, 0.5);
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.05);
}

.dropzone-icon {
    font-size: 2.75rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.dropzone-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.35rem;
}

.dropzone-subtext {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Forms & Controls */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    background: #121215;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: #fff;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-indigo), #4f46e5);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.8rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #27272a;
    color: #fafafa;
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-md);
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #3f3f46;
}

/* File list items */
.file-list {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.file-item {
    background: #121215;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-remove {
    background: none;
    border: none;
    color: var(--accent-rose);
    cursor: pointer;
    font-size: 1.25rem;
}

/* Search Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

.modal-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 580px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.modal-search-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    color: #fff;
    font-size: 1.15rem;
    outline: none;
}

.modal-results {
    max-height: 360px;
    overflow-y: auto;
    padding: 0.5rem;
}

.modal-result-item {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.15s;
}

.modal-result-item:hover, .modal-result-item.selected {
    background: #27272a;
}

/* Footer */
footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-links {
    margin-top: 0.5rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    .search-trigger {
        min-width: unset;
        padding: 0.4rem 0.75rem;
    }
    .kbd {
        display: none;
    }
    .tool-view-card {
        padding: 1.25rem;
    }
}
