/* ============================================
   PAKET 02 - ADVANCED TOOLS SUITE
   LAYOUT: SIDEBAR + DASHBOARD
   ============================================ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --bg: #0f172a;
    --bg-light: #1e293b;
    --text: #e2e8f0;
    --text-light: #94a3b8;
    --border: #334155;
    --card-bg: #1e293b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-hover: #1e293b;
    --sidebar-active: #6366f1;
    --header-bg: #0f172a;
    --footer-bg: #0f172a;
    --footer-text: #94a3b8;
    --sidebar-width: 280px;
    --topbar-height: 60px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ===== TOP BAR ===== */
.topbar {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    height: var(--topbar-height);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 10px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: bold;
    font-size: 1.1rem;
    white-space: nowrap;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-icon svg { width: 18px; height: 18px; }

.topbar nav { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

.topbar nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 0.8rem;
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.topbar nav a:hover { background: var(--bg-light); color: var(--text); }

.nav-icon { display: flex; align-items: center; }
.nav-icon svg { width: 16px; height: 16px; }

/* ===== HAMBURGER ===== */
.sidebar-toggle {
    display: none;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.sidebar-toggle:hover { background: var(--primary-dark); }
.sidebar-toggle svg { width: 20px; height: 20px; }

/* ===== OVERLAY ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 90;
}

.sidebar-overlay.active { display: block; }

/* ===== LAYOUT ===== */
.layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    flex: 1;
    width: 100%;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 1.5rem 1rem;
    position: sticky;
    top: var(--topbar-height);
    height: calc(100vh - var(--topbar-height));
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.sidebar-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin: 0 auto 0.5rem;
}

.sidebar-logo svg { width: 24px; height: 24px; }

.sidebar-header .sidebar-title { font-size: 1rem; font-weight: bold; color: var(--text); }
.sidebar-header .sidebar-subtitle { font-size: 0.75rem; color: var(--sidebar-text); margin-top: 0.2rem; }

.sidebar-section { margin-bottom: 1rem; }

.sidebar-section .sidebar-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-bottom: 0.4rem;
    padding: 0 0.5rem;
}

.sidebar-section .sidebar-title a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.sidebar-section .sidebar-title a:hover { color: var(--primary); }
.sidebar-section .sidebar-title svg { width: 14px; height: 14px; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--sidebar-text);
    font-size: 0.82rem;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-link:hover { background: var(--sidebar-hover); color: var(--text); }

.sidebar-icon { display: flex; align-items: center; flex-shrink: 0; }
.sidebar-icon svg { width: 15px; height: 15px; }

/* ===== MAIN CONTENT ===== */
.main-content { flex: 1; padding: 2rem; min-width: 0; }

/* ===== BREADCRUMB ===== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 2.5rem 20px;
    text-align: center;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.hero h1 { font-size: 1.8rem; margin-bottom: 0.5rem; font-weight: 700; }
.hero p { font-size: 1rem; opacity: 0.9; }

.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-top: 1rem;
}

/* ===== CATEGORY CARDS ===== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.category-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text);
    text-align: center;
    transition: all 0.3s;
}

.category-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.category-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.8rem;
    color: var(--primary);
}

.category-icon svg { width: 22px; height: 22px; }
.category-card h3 { font-size: 0.95rem; margin-bottom: 0.3rem; }
.category-card p { font-size: 0.8rem; color: var(--text-light); }

/* ===== SECTION TITLE ===== */
.section-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 1rem; }

/* ===== TOOLS GRID ===== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.tool-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.2rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tool-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.tool-card .tool-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.tool-card .tool-icon svg { width: 20px; height: 20px; }
.tool-card .tool-info { min-width: 0; }
.tool-card .tool-info h3 { font-size: 0.9rem; margin-bottom: 0.2rem; }
.tool-card .tool-info p { font-size: 0.78rem; color: var(--text-light); }

/* ===== TOOL PAGE ===== */
.tool-page h1 { font-size: 1.6rem; margin-bottom: 0.5rem; font-weight: 700; }
.tool-intro { color: var(--text-light); margin-bottom: 1.5rem; font-size: 0.9rem; }

.tool-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.tool-box textarea {
    width: 100%;
    min-height: 150px;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.tool-box textarea:focus,
.tool-box input:focus,
.tool-box select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
}

.tool-box input,
.tool-box select {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.tool-box label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text-light); }

.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
    white-space: nowrap;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #475569; }
.btn-copy { background: var(--success); color: white; }

/* ===== STATS ===== */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin: 1rem 0;
}

.stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.8rem;
    text-align: center;
}

.stat-number { font-size: 1.4rem; font-weight: bold; color: var(--primary); }
.stat-label { font-size: 0.7rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; }

/* ===== OUTPUT ===== */
.output-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.8rem;
    min-height: 50px;
    margin: 0.5rem 0;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
}

/* ===== CONTENT SECTION ===== */
.content-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.content-section h2 { font-size: 1.2rem; margin-bottom: 0.8rem; font-weight: 700; }
.content-section h3 { font-size: 1rem; margin: 0.8rem 0 0.4rem; font-weight: 600; }
.content-section p { color: var(--text-light); margin-bottom: 0.8rem; font-size: 0.9rem; }
.content-section ol, .content-section ul { padding-left: 1.5rem; color: var(--text-light); font-size: 0.9rem; }
.content-section li { margin-bottom: 0.3rem; }

/* ===== FAQ ===== */
.faq-item { margin-bottom: 1rem; }
.faq-item h3 { color: var(--text); font-size: 0.95rem; margin-bottom: 0.3rem; }
.faq-item p { color: var(--text-light); font-size: 0.85rem; }

/* ===== RELATED TOOLS ===== */
.related-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.related-tool {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.7rem 0.9rem;
    text-decoration: none;
    color: var(--text);
    font-size: 0.82rem;
    transition: all 0.2s;
}

.related-tool:hover { border-color: var(--primary); }
.related-tool svg { width: 15px; height: 15px; }

/* ===== AD ===== */
.ad-container { max-width: 1200px; margin: 1rem auto; padding: 0 20px; text-align: center; }

/* ===== FOOTER ===== */
footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--border);
    color: var(--text);
    padding: 2rem 20px;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.footer-section h4 { margin-bottom: 0.8rem; font-size: 0.95rem; font-weight: 700; }
.footer-section ul { list-style: none; }
.footer-section ul li { margin-bottom: 0.4rem; }
.footer-section a { color: var(--footer-text); text-decoration: none; font-size: 0.85rem; transition: color 0.2s; }
.footer-section a:hover { color: white; }
.footer-section p { color: var(--footer-text); font-size: 0.85rem; }

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--footer-text);
    font-size: 0.8rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    :root { --sidebar-width: 240px; }
    .tools-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

@media (max-width: 768px) {
    .sidebar-toggle { display: flex; }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        z-index: 95;
        transition: left 0.3s ease;
        box-shadow: 2px 0 15px rgba(0,0,0,0.5);
    }
    
    .sidebar.active { left: 0; }
    
    .layout { flex-direction: column; }
    
    .main-content { max-width: 100%; padding: 1rem; }
    
    .topbar nav a span:last-child { display: none; }
    .topbar nav a { padding: 0.5rem; }
    
    .hero { padding: 1.5rem 12px; }
    .hero h1 { font-size: 1.4rem; }
    
    .tools-grid { grid-template-columns: 1fr; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    
    .tool-card .tool-info p { white-space: normal; }
}

@media (max-width: 480px) {
    .category-grid { grid-template-columns: 1fr; }
    
    .btn { width: 100%; text-align: center; margin-bottom: 0.4rem; }
    
    .stats { grid-template-columns: repeat(2, 1fr); }
    .tool-box { padding: 1rem; }
    
    .footer-container { grid-template-columns: 1fr; text-align: center; }
}