﻿/* === Reset === */
*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    color: #2c3e50;
    line-height: 1.6;
}

/* === Top Bar === */
.topbar {
    background: #1a1a2e;
    height: 44px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    padding: 0 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-brand { font-size: 1rem; font-weight: 700; color: #fff; text-decoration: none; letter-spacing: -0.3px; }
.topbar-brand:hover { color: #fff; }
.topbar-link { color: rgba(255,255,255,0.5); text-decoration: none; margin-left: 1rem; font-size: 0.8rem; transition: color 0.15s; }
.topbar-link:hover { color: rgba(255,255,255,0.85); }
.sidebar-toggle { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); border-radius: 4px; font-size: 1rem; cursor: pointer; color: #fff; padding: 4px 8px; line-height: 1; }
.sidebar-toggle:hover { background: rgba(255,255,255,0.16); }

/* === App Layout === */
.app-layout { display: flex; min-height: calc(100vh - 44px); }

/* === Sidebar === */
.sidebar {
    width: 170px;
    min-width: 170px;
    flex-shrink: 0;
    background: #1a1a2e;
    color: rgba(255,255,255,0.65);
    overflow-y: auto;
    padding: 10px 0;
    position: relative;
    transition: width 0.2s, min-width 0.2s;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.sidebar-collapsed { width: 34px; min-width: 34px; padding: 8px 0; }
.sidebar-collapsed .sidebar-nav,
.sidebar-collapsed .sidebar-section { display: none; }

.sidebar-section { margin-bottom: 6px; }
.sidebar-title {
    padding: 8px 16px 4px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.28);
}
.sidebar-link {
    display: block;
    padding: 5px 16px 5px 20px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all 0.12s;
}
.sidebar-link:hover { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.85); }
.sidebar-link.active {
    background: rgba(99,102,241,0.1);
    color: #818cf8;
    font-weight: 600;
    border-left-color: #818cf8;
}

.sidebar-grip {
    position: absolute;
    right: 0; top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: #fff; font-size: 12px; font-weight: 700;
    background: #6366f1;
    border: none;
    border-radius: 4px 0 0 4px;
    transition: all 0.15s;
    z-index: 20;
    opacity: 0.7;
}
.sidebar-grip:hover { opacity: 1; width: 22px; }
.sidebar-collapsed .sidebar-grip { right: auto; left: 0; border-radius: 0 4px 4px 0; width: 22px; }

/* === Main Content === */
.main-content { flex: 1; min-width: 0; padding: 20px 24px; background: #fff; }

/* === Tool Heading === */
.tool-heading { font-size: 1.25rem; font-weight: 700; margin: 0 0 2px; color: #1a1a2e; }
.tool-subtitle { font-size: 0.82rem; color: #8b8fa3; margin: 0 0 14px; }

/* === Tool Panels === */
.tool-panels { display: flex; gap: 12px; }
.tool-panel { flex: 1 1 0%; min-width: 0; display: flex; flex-direction: column; }
.tool-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.tool-label { font-size: 0.75rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; }
.tool-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.tool-btn-clear { background: none; border: none; font-size: 0.75rem; color: #9ca3af; cursor: pointer; padding: 0; }
.tool-btn-clear:hover { color: #ef4444; }
.tool-stats { font-size: 0.75rem; color: #9ca3af; margin-top: 2px; }

.tool-btn {
    font-size: 0.76rem; padding: 3px 9px; border-radius: 4px;
    border: 1px solid #d1d5db; background: #fff; color: #4b5563;
    cursor: pointer; transition: all 0.1s; white-space: nowrap;
}
.tool-btn:hover { background: #f3f4f6; border-color: #9ca3af; }
.tool-btn.active { background: #374151; border-color: #374151; color: #fff; }
.tool-btn.primary { background: #6366f1; border-color: #6366f1; color: #fff; font-weight: 600; }
.tool-btn.primary:hover { background: #4f46e5; border-color: #4f46e5; }
.tool-btn.copy-done { background: #059669; border-color: #059669; color: #fff; font-weight: 600; }

/* === Textarea & Output === */
.tool-textarea, .output-area {
    display: block;
    width: 100% !important;
    height: calc(100vh - 260px);
    max-height: 700px;
    min-height: 350px;
    overflow: auto;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 13px;
    line-height: 1.5;
    padding: 12px;
    background: #fafbfc;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s;
}
.tool-textarea:focus, .output-area:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }

/* === Footer === */
.footer { padding: 24px 0; background: #1a1a2e; color: rgba(255,255,255,0.35); border-top: 1px solid rgba(255,255,255,0.05); }
.footer a { color: rgba(255,255,255,0.4); text-decoration: none; }
.footer a:hover { color: rgba(255,255,255,0.7); }

/* === Toast === */
.toast-container { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast-item { padding: 7px 18px; background: #374151; color: #fff; border-radius: 6px; font-size: 0.82rem; font-weight: 500; box-shadow: 0 4px 20px rgba(0,0,0,0.18); }
.toast-item.success { background: #059669; }
.toast-item.error { background: #dc2626; }
.toast-enter { transition: all 0.2s ease-out; }
.toast-leave { transition: all 0.2s ease-in; }
.toast-enter-start { opacity: 0; transform: translateY(10px); }
.toast-enter-end { opacity: 1; transform: translateY(0); }
.toast-leave-start { opacity: 1; }
.toast-leave-end { opacity: 0; }

/* === Accordion === */
.accordion-button:not(.collapsed) { background-color: #f0f0ff; color: #3730a3; box-shadow: none; }
.accordion-button:focus { box-shadow: 0 0 0 2px rgba(99,102,241,0.15); border-color: #c7d2fe; }
.accordion-item { border-color: #e5e7eb; }

/* === Responsive === */
@media (max-width: 768px) {
    .tool-panels { flex-direction: column; }
    .tool-textarea, .output-area { height: 300px; max-height: none; }
    .sidebar { max-height: 120px; overflow-y: auto; }
    .main-content { padding: 10px; }
}

/* === Cookie Banner === */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10000; background: #1f2937; color: #e5e7eb; box-shadow: 0 -2px 16px rgba(0,0,0,0.15); }
.cookie-banner-content { max-width: 960px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cookie-banner-text { font-size: 0.82rem; flex: 1; min-width: 240px; }
.cookie-banner-actions { display: flex; align-items: center; flex-shrink: 0; }
.cookie-enter { transition: all 0.3s ease-out; }
.cookie-leave { transition: all 0.2s ease-in; }
.cookie-enter-start { opacity: 0; transform: translateY(20px); }
.cookie-enter-end { opacity: 1; transform: translateY(0); }
.cookie-leave-start { opacity: 1; }
.cookie-leave-end { opacity: 0; }
[x-cloak] { display: none !important; }

/* === Landing Page === */
.tool-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 1px solid #e8eaed !important;
    border-radius: 8px;
}
.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.08) !important;
    border-color: #c7d2fe !important;
}
.tool-icon {
    font-size: 1.1rem;
    color: #6366f1;
    font-weight: 700;
    font-family: "SF Mono", "Fira Code", monospace;
}

/* Landing SEO section */
.seo-section h2 { font-size: 1.1rem; font-weight: 600; color: #1a1a2e; }
.seo-section p { color: #4b5563; font-size: 0.92rem; line-height: 1.65; }
.faq-section .accordion-button { font-size: 0.9rem; font-weight: 500; }

/* === Timestamp Converter === */
.current-ts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 24px; }
.ts-card { background: #f8f9fa; border: 1px solid #e0e0e0; border-radius: 6px; padding: 12px; }
.ts-card .ts-label { display: block; font-size: 12px; color: #888; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.ts-card input { width: 100%; border: none; background: transparent; font-family: monospace; font-size: 14px; color: #333; cursor: pointer; }
.ts-card input:focus { outline: none; }
.convert-row { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.convert-row input[type="text"] { flex: 1; min-width: 200px; padding: 10px 14px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; font-family: monospace; }
.convert-row input[type="datetime-local"] { flex: 1; min-width: 200px; padding: 10px 14px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; }
.convert-row select { padding: 10px 14px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; }
.convert-row button { padding: 10px 20px; background: #6366f1; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 500; }
.convert-row button:hover { background: #4f46e5; }
.result-box { background: #f0f0ff; border: 1px solid #c7d2fe; border-radius: 6px; padding: 14px; margin-bottom: 16px; }
.result-box div { margin-bottom: 6px; font-size: 14px; }
.result-box div:last-child { margin-bottom: 0; }
.result-box span { font-family: monospace; color: #3730a3; }
.related-tools { margin-top: 32px; }
.related-tools h3 { font-size: 16px; color: #333; margin-bottom: 12px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.related-card { background: #f8f9fa; border: 1px solid #e0e0e0; border-radius: 6px; padding: 12px; text-decoration: none; color: #333; font-size: 14px; text-align: center; transition: all 0.2s; }
.related-card:hover { background: #eef2ff; border-color: #c7d2fe; }
.faq-section h3 { font-size: 16px; color: #333; margin: 32px 0 12px; }
.faq-section details { background: #f8f9fa; border: 1px solid #e0e0e0; border-radius: 6px; padding: 12px 14px; margin-bottom: 8px; }
.faq-section details summary { cursor: pointer; font-weight: 500; font-size: 14px; }
.faq-section details p { margin: 10px 0 0; color: #555; font-size: 14px; line-height: 1.6; }
.tool-container { max-width: 800px; margin: 0 auto; }
.tool-container h1 { font-size: 1.5rem; color: #1a1a2e; margin-bottom: 8px; font-weight: 700; }
.tool-intro { color: #6b7280; font-size: 0.93rem; margin-bottom: 28px; }
.tool-section h2 { font-size: 1.05rem; font-weight: 600; color: #2c3e50; margin: 24px 0 14px; padding-bottom: 8px; border-bottom: 1px solid #e5e7eb; }
