:root {
    /* PREMIUM DARK THEME PALETTE */
    --bg-main: #030303;       /* Deepest Black */
    --bg-surface: #0a0a0a;    /* Panel Background */
    --bg-highlight: #141414;  /* Hover Background */

    --border-dim: #222;       /* Subtle Border */
    --border-light: #333;     /* Visible Border */

    --text-primary: #ededed;  /* Main Text */
    --text-secondary: #888888;/* Subtext */
    --text-muted: #555555;    /* Very dim text */

    --accent: #fff;           /* Accent Color */

    --font-ui: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* RESET & BASE */
* { margin: 0; padding: 0; box-sizing: border-box; outline: none; }

body { 
    background-color: var(--bg-main); 
    color: var(--text-primary); 
    font-family: var(--font-ui); 
    font-size: 14px; 
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* LAYOUT GRID */
.app-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    background: var(--bg-main);
    border-right: 1px solid var(--border-dim);
    padding: 24px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.logo {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 35px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 8px;
    letter-spacing: -1px;
}
.logo span { background: #333; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; color: #fff; letter-spacing: 0; }

.nav-group { margin-bottom: 25px; }
.nav-header { 
    font-size: 0.7rem; 
    text-transform: uppercase; 
    color: var(--text-muted); 
    margin-bottom: 10px; 
    padding-left: 12px;
    letter-spacing: 1px; 
    font-weight: 700;
}

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: all 0.2s;
    margin-bottom: 2px;
    font-weight: 500;
    font-size: 0.9rem;
}
.nav-item:hover, .nav-item.active {
    background: var(--bg-highlight);
    color: var(--text-primary);
}
.nav-item svg { width: 18px; height: 18px; opacity: 0.6; }
.nav-item:hover svg { opacity: 1; }

/* MAIN CONTENT */
.main-content {
    padding: 40px 60px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* TOP BAR */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 50px;
}

.hero-text h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -1px;
    color: var(--text-primary);
}
.hero-text p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* SEARCH BOX */
.search-container { position: relative; width: 380px; }
.search-input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    padding: 14px 16px 14px 44px;
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-ui);
    transition: 0.2s;
    font-size: 0.95rem;
}
.search-input:focus {
    border-color: var(--border-light);
    background: #111;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.02);
}
.search-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-secondary); width: 18px;
}
.kbd-shortcut {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    background: #222; padding: 3px 6px; border-radius: 4px;
    font-size: 11px; color: #777; font-family: var(--font-mono); border: 1px solid #333;
}

/* ADSENSE SLOT */
.ad-slot {
    margin: 30px 0 50px;
    background: repeating-linear-gradient(45deg, #0a0a0a, #0a0a0a 10px, #0f0f0f 10px, #0f0f0f 20px);
    border: 1px dashed var(--border-dim);
    border-radius: 8px;
    height: 100px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 0.8rem; letter-spacing: 1px;
}

/* SECTIONS & GRID */
.section-header {
    margin: 60px 0 25px;
    display: flex; align-items: center; gap: 12px;
    padding-bottom: 15px; border-bottom: 1px solid var(--border-dim);
}
.section-title { font-size: 1.2rem; font-weight: 600; color: var(--text-primary); }
.section-icon { color: var(--text-secondary); }

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

/* CARDS */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    padding: 24px;
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    display: flex; flex-direction: column; gap: 12px;
    height: 170px;
    text-decoration: none;
}

.card:hover {
    border-color: var(--border-light);
    background: var(--bg-highlight);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -10px rgba(0,0,0,0.5);
}

.card-icon-box {
    width: 36px; height: 36px;
    background: #111; border: 1px solid #222; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-primary); font-family: var(--font-mono); font-size: 1rem;
    margin-bottom: auto;
}
.card-icon { 
    width: 36px; height: 36px;
    background: #111; border: 1px solid #222; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-primary); font-family: var(--font-mono); font-size: 1rem;
    margin-bottom: auto;
}

.card h3 { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.card p {
    font-size: 0.85rem; color: var(--text-secondary);
    line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}

/* BADGES */
.badge {
    position: absolute; top: 24px; right: 24px;
    font-size: 10px; font-weight: 700; padding: 4px 8px;
    border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-hot { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-new { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-pro { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }

/* TOOL PAGE */
.tool-header{
    margin-bottom: 20px;
    display:flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
}
.tool-header h1{
    font-size: 1.9rem;
    letter-spacing: -1px;
}
.tool-header p{
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 920px;
}
.lang-switch{
    display:flex;
    gap:8px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}
.lang-switch a{
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    color: var(--text-secondary);
    transition: .2s;
}
.lang-switch a.active, .lang-switch a:hover{
    color: var(--text-primary);
    border-color: var(--border-light);
    background: var(--bg-highlight);
}

.tool-form{
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media(max-width: 1024px){
    .tool-form{ grid-template-columns: 1fr; }
}

.panel{
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    padding: 18px;
}
.panel h2{
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}
textarea, input[type="text"], input[type="number"], input[type="url"], select{
    width: 100%;
    background: #0b0b0b;
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    padding: 12px 12px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
}
textarea{ min-height: 260px; resize: vertical; }
input[type="file"]{
    width: 100%;
    color: var(--text-secondary);
}
.option-row{
    margin-top: 10px;
    display:flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.option-row label{
    color: var(--text-secondary);
    font-size: 12px;
    font-family: var(--font-mono);
    display:flex;
    align-items:center;
    gap:6px;
}
.btn-row{
    margin-top: 12px;
    display:flex;
    gap: 10px;
    flex-wrap: wrap;
}
button, .btn{
    cursor:pointer;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-dim);
    background: #111;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    transition: .2s;
}
button:hover, .btn:hover{
    background: var(--bg-highlight);
    border-color: var(--border-light);
}
.notice{
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    border: 1px solid var(--border-dim);
    color: var(--text-secondary);
    background: rgba(255,255,255,0.02);
}
.notice.error{
    border-color: rgba(239,68,68,0.25);
    color: #ef4444;
    background: rgba(239,68,68,0.06);
}
.notice.success{
    border-color: rgba(16,185,129,0.25);
    color: #10b981;
    background: rgba(16,185,129,0.06);
}
.codeblock{
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* FOOTER */
footer {
    margin-top: 100px; padding-top: 40px; border-top: 1px solid var(--border-dim);
    color: var(--text-secondary); font-size: 0.85rem;
    display: flex; justify-content: space-between; align-items: center;
}

/* ICONS */
svg { stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; stroke: currentColor; }

/* RESPONSIVE */
@media (max-width: 1024px) {
    .app-layout { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .main-content { padding: 30px 20px; }
    .hero-text h1 { font-size: 1.8rem; }
    .search-container { width: 100%; }
    .tool-header{ flex-direction: column; align-items: flex-start; }
}
