/* DEV-SPHER Design System - Ecosystem Update */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    /* Color Palette */
    --bg-deep: #050508;
    --bg-surface: #0f0f16;
    --bg-card: #14141c;
    --border-color: rgba(255, 255, 255, 0.08);

    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --text-muted: #5a5a6a;

    --accent-cyan: #00f3ff;
    --accent-purple: #9d00ff;
    --accent-error: #ff2a6d;
    --accent-success: #05ffa1;

    --glow-cyan: 0 0 20px rgba(0, 243, 255, 0.15);

    /* Spacing */
    --container-width: 1400px;
    --header-height: 70px;

    /* Animation */
    --trans-fast: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --trans-smooth: 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

code,
pre,
.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-4 {
    gap: 1rem;
}

.gap-8 {
    gap: 2rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Header */
.app-header {
    height: var(--header-height);
    background: rgba(5, 5, 8, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-decoration: none;
    color: var(--text-primary);
}

.brand span {
    color: var(--accent-cyan);
}

/* Hero & Search */
.dashboard-hero {
    padding: 80px 0 60px;
    text-align: center;
    background: radial-gradient(circle at center, rgba(157, 0, 255, 0.08) 0%, transparent 70%);
}

.dashboard-hero h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.search-box {
    margin: 2rem auto 0;
    max-width: 600px;
    position: relative;
}

.search-input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: 99px;
    font-size: 1.1rem;
    color: var(--text-primary);
    transition: var(--trans-fast);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: var(--glow-cyan);
}

/* Category Sections */
.category-section {
    margin-bottom: 4rem;
}

.category-title {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 1rem;
    transition: color 0.3s;
    position: relative;
}

.category-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--border-color) 20%,
            var(--accent-cyan) 50%,
            var(--border-color) 80%,
            transparent 100%);
    background-size: 200% 100%;
    animation: beam-flow 4s linear infinite;
    opacity: 0.5;
}

@keyframes beam-flow {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

.category-toggle-icon {
    display: none;
    /* Hidden on Desktop */
    margin-left: auto;
    transition: transform 0.3s ease;
    font-size: 0.8em;
    opacity: 0.7;
}

.category-section.active .category-toggle-icon {
    transform: rotate(180deg);
    color: var(--accent-cyan);
}

/* Tool Grid - HUD Style */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: rgba(20, 20, 28, 0.6);
    /* HUD Base */
    border: 1px solid transparent;
    /* Replaced by pseudo-borders */
    padding: 1.5rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;

    /* Clip Path for Corners */
    clip-path: polygon(10px 0, 100% 0,
            100% calc(100% - 10px), calc(100% - 10px) 100%,
            0 100%, 0 10px);
}

/* HUD Borders using Pseudo Elements */
.tool-card::before,
.tool-card::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: all 0.4s ease;
    z-index: 2;
    pointer-events: none;
}

/* Top Left */
.tool-card::before {
    top: 0;
    left: 0;
    border-width: 2px 0 0 2px;
}

/* Bottom Right */
.tool-card::after {
    bottom: 0;
    right: 0;
    border-width: 0 2px 2px 0;
}

.tool-card:hover {
    background: rgba(20, 20, 28, 0.8);
    transform: translateY(-5px);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.1);
}

.tool-card:hover::before,
.tool-card:hover::after {
    border-color: var(--accent-cyan);
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.tool-card.disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(1);
}

/* Scanline Animation */
.scanline {
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to bottom, transparent, rgba(0, 243, 255, 0.1), transparent);
    animation: scan-down 4s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 1;
}

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

@keyframes scan-down {
    0% {
        top: -100%;
    }

    100% {
        top: 200%;
    }
}


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

.tool-icon-sm {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
    transition: transform 0.3s;
}

.tool-card:hover .tool-icon-sm {
    transform: scale(1.2);
}

.tool-badges {
    display: flex;
    gap: 0.5rem;
}

.tool-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.tool-badge.client {
    color: var(--accent-success);
    border: 1px solid rgba(5, 255, 161, 0.2);
}

.tool-badge.server {
    color: var(--accent-purple);
    border: 1px solid rgba(157, 0, 255, 0.2);
}

.tool-badge.popular {
    color: #ffb700;
    border: 1px solid rgba(255, 183, 0, 0.2);
}

.tool-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
}

.tool-card:hover .tool-title {
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

.tool-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    position: relative;
    z-index: 2;
}


/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    /* Slightly sharper */
    font-weight: 600;
    cursor: pointer;
    transition: var(--trans-fast);
    border: none;
    font-family: inherit;
    gap: 0.5rem;
    text-decoration: none;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

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

.btn-primary:hover {
    background: #50fbff;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-cyan);
}

/* Specific UI for Tools */
.ui-panel {
    background: rgba(20, 20, 28, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    /* Reduced radius */
    padding: 2rem;
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
    position: relative;
}

/* Add HUD borders to UI Panel too */
.ui-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    border-top: 2px solid var(--accent-cyan);
    border-left: 2px solid var(--accent-cyan);
    pointer-events: none;
}

.ui-panel::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 30px;
    height: 30px;
    border-bottom: 2px solid var(--accent-cyan);
    border-right: 2px solid var(--accent-cyan);
    pointer-events: none;
}


.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 600px;
}

.editor-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-card);
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.code-area {
    flex: 1;
    background: var(--bg-deep);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    padding: 1rem;
    resize: none;
    line-height: 1.5;
}

.code-area:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

.error-msg {
    color: var(--accent-error);
    font-size: 0.9rem;
}

/* Mobile */
@media (max-width: 768px) {
    .editor-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .code-area {
        min-height: 300px;
    }

    .dashboard-hero h1 {
        font-size: 2.5rem;
    }

    /* Mobile Category Toggles */
    .category-title {
        cursor: pointer;
        user-select: none;
    }

    .category-title:hover {
        color: var(--text-primary);
    }

    .category-toggle-icon {
        display: block;
    }

    .category-section .tools-grid {
        display: none;
        /* Collapsed by default */
        animation: slideDownGrid 0.3s ease-out;
    }

    .category-section.active .tools-grid {
        display: grid;
        /* Expanded */
    }

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

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-muted);
}

/* --- Suggestion Board --- */
.suggestion-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Form Styles */
.suggestion-form-panel .form-group {
    margin-bottom: 1.2rem;
}

.suggestion-form-panel label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
}

.suggestion-form-panel .search-input {
    background: rgba(0, 0, 0, 0.3);
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
}

.suggestion-form-panel .search-input:focus,
.suggestion-form-panel .code-area:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.1);
}

.checkbox-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
}

.checkbox-label input {
    accent-color: var(--accent-cyan);
}

/* Sticky Wall */
.suggestion-wall-container {
    background: rgba(20, 20, 28, 0.3);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 20px;
    min-height: 600px;
    max-height: 800px;
    overflow-y: auto;
}

.sticky-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    align-content: start;
}

.sticky-wall.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
}

.empty-state {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    opacity: 0.5;
    letter-spacing: 2px;
}

/* Sticky Note Card */
.sticky-note {
    background: #fff;
    /* Fallback */
    color: #111;
    padding: 20px;
    font-family: 'Outfit', sans-serif;
    position: relative;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.3);
    transform: rotate(var(--rot));
    transition: transform 0.3s ease, z-index 0s;
    cursor: default;
    overflow: hidden;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 2px;
}

.sticky-note:hover {
    transform: scale(1.05) rotate(0deg);
    z-index: 10;
    box-shadow: 10px 10px 25px rgba(0, 0, 0, 0.4);
}

/* Themes */
.note-theme-cyan {
    background: #dffeff;
    border-left: 4px solid #00cbd6;
}

.note-theme-pink {
    background: #ffdfef;
    border-left: 4px solid #ff0055;
}

.note-theme-yellow {
    background: #fffdcf;
    border-left: 4px solid #ffcc00;
}

.note-theme-purple {
    background: #f3dfff;
    border-left: 4px solid #aa00ff;
}

/* Note Content */
.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 8px;
}

.note-author {
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.note-date {
    font-size: 0.7rem;
    color: rgba(0, 0, 0, 0.5);
    font-family: 'JetBrains Mono', monospace;
    text-align: right;
}

.note-tool-req {
    background: rgba(0, 0, 0, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: inline-block;
}

.note-body {
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 15px;
    word-wrap: break-word;
}

.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.note-tag {
    font-size: 0.65rem;
    padding: 2px 6px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 99px;
    color: rgba(0, 0, 0, 0.6);
}

/* Mobile */
@media (max-width: 900px) {
    .suggestion-layout {
        grid-template-columns: 1fr;
    }

    .sticky-wall {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}