/* ========================================
   timologisi Help Manual - Stylesheet
   ======================================== */

/* --- CSS Custom Properties --- */
:root {
    /* Brand Colors */
    --primary-dark: #343e4b;
    --primary-darker: #2a323d;
    --accent-teal: #18b4aa;
    --accent-teal-hover: #14a099;
    --accent-teal-light: rgba(24, 180, 170, 0.1);

    /* Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f7fa;
    --bg-card: #ffffff;
    --bg-nav: #343e4b;
    --bg-hero: #f5f7fa;
    --text-primary: #2c3e50;
    --text-secondary: #5a6a7a;
    --text-muted: #8899aa;
    --text-nav: #ffffff;
    --text-nav-hover: #18b4aa;
    --border-color: #e2e8f0;
    --border-light: #eef2f7;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
    --search-bg: rgba(255, 255, 255, 0.12);
    --search-bg-focus: #ffffff;
    --overlay-bg: rgba(0, 0, 0, 0.5);
    --card-hover-translate: -2px;
    --code-bg: #f0f4f8;
    --kbd-bg: #eef2f7;
    --kbd-border: #d1d9e0;
    --welcome-bg: linear-gradient(135deg, #18b4aa 0%, #14a099 100%);
    --footer-bg: #343e4b;
    --footer-text: #a0aec0;
}

[data-theme="dark"] {
    --bg-primary: #1a1f2e;
    --bg-secondary: #212738;
    --bg-card: #262d40;
    --bg-nav: #161b28;
    --bg-hero: #212738;
    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    --text-nav: #e2e8f0;
    --text-nav-hover: #18b4aa;
    --border-color: #2d3748;
    --border-light: #2d3748;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.3);
    --search-bg: rgba(255, 255, 255, 0.08);
    --search-bg-focus: #2d3748;
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --code-bg: #2d3748;
    --kbd-bg: #2d3748;
    --kbd-border: #4a5568;
    --footer-bg: #161b28;
    --footer-text: #718096;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Roboto Condensed', 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent-teal);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-teal-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

/* --- Top Navigation --- */
.navbar {
    background-color: var(--bg-nav);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.navbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 24px;
    height: 60px;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 32px;
    flex-shrink: 0;
}

.navbar-logo img {
    height: 32px;
    width: auto;
}

.navbar-logo span {
    color: var(--text-nav);
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.7;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 10px;
}

/* --- Nav Tabs --- */
.nav-tabs {
    display: flex;
    list-style: none;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tabs li a {
    display: block;
    padding: 18px 14px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.nav-tabs li a:hover {
    color: #ffffff;
    border-bottom-color: rgba(24, 180, 170, 0.5);
}

.nav-tabs li a.active {
    color: #ffffff;
    border-bottom-color: var(--accent-teal);
}

/* --- Nav Actions (Search + Theme toggle) --- */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.nav-search-btn,
.nav-theme-btn,
.nav-support-btn {
    background: var(--search-bg);
    border: none;
    color: rgba(255, 255, 255, 0.7);
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    font-size: 1.1rem;
}

.nav-search-btn:hover,
.nav-theme-btn:hover,
.nav-support-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.nav-support-btn {
    text-decoration: none;
}

.nav-support-btn .support-label {
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 5px;
    white-space: nowrap;
}

.nav-support-btn {
    width: auto;
    padding: 0 12px;
    gap: 4px;
}

/* --- Mobile Hamburger --- */
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
}

/* --- Hero Section --- */
.hero {
    background-color: var(--bg-hero);
    border-bottom: 1px solid var(--border-color);
    padding: 48px 24px 40px;
    text-align: center;
}

.hero-inner {
    max-width: 720px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    color: var(--primary-dark);
}

[data-theme="dark"] .hero h1 {
    color: var(--text-primary);
}

.hero h1 .brand-highlight {
    color: var(--accent-teal);
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 28px;
}

/* --- Search Bar (Hero) --- */
.search-container {
    position: relative;
    max-width: 560px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 14px 80px 14px 46px;
    font-family: inherit;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 3px var(--accent-teal-light);
}

.search-kbd {
    position: absolute;
    right: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
    pointer-events: none;
}

.search-kbd kbd {
    background: var(--kbd-bg);
    border: 1px solid var(--kbd-border);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Welcome Banner --- */
.welcome-banner {
    background: var(--welcome-bg);
    border-radius: 12px;
    padding: 20px 28px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #ffffff;
}

.welcome-banner-text {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
}

.welcome-banner-text .welcome-icon {
    font-size: 1.3rem;
}

.welcome-banner-text strong {
    font-weight: 700;
}

.welcome-banner a {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: background 0.2s;
}

.welcome-banner a:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

/* --- Main Content Area --- */
.main-content {
    flex: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px 48px;
    width: 100%;
}

/* --- Category Cards Grid --- */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 8px;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-teal);
    border-radius: 10px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
    position: relative;
}

.category-card:hover {
    transform: translateY(var(--card-hover-translate));
    box-shadow: var(--shadow-md);
    color: inherit;
}

.category-card .card-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--accent-teal-light);
}

.category-card .card-content {
    flex: 1;
    min-width: 0;
}

.category-card .card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-card .card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.category-card .card-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: transform 0.2s, color 0.2s;
}

.category-card:hover .card-arrow {
    transform: translateY(-50%) translateX(3px);
    color: var(--accent-teal);
}

/* Card border color variants */
.category-card[data-color="teal"]    { border-left-color: #18b4aa; }
.category-card[data-color="blue"]    { border-left-color: #4299e1; }
.category-card[data-color="purple"]  { border-left-color: #805ad5; }
.category-card[data-color="orange"]  { border-left-color: #ed8936; }
.category-card[data-color="green"]   { border-left-color: #48bb78; }
.category-card[data-color="red"]     { border-left-color: #fc5c65; }
.category-card[data-color="indigo"]  { border-left-color: #667eea; }

.category-card[data-color="teal"]  .card-icon { background: rgba(24, 180, 170, 0.1); color: #18b4aa; }
.category-card[data-color="blue"]  .card-icon { background: rgba(66, 153, 225, 0.1); color: #4299e1; }
.category-card[data-color="purple"] .card-icon { background: rgba(128, 90, 213, 0.1); color: #805ad5; }
.category-card[data-color="orange"] .card-icon { background: rgba(237, 137, 54, 0.1); color: #ed8936; }
.category-card[data-color="green"]  .card-icon { background: rgba(72, 187, 120, 0.1); color: #48bb78; }
.category-card[data-color="red"]   .card-icon { background: rgba(252, 92, 101, 0.1); color: #fc5c65; }
.category-card[data-color="indigo"] .card-icon { background: rgba(102, 126, 234, 0.1); color: #667eea; }

/* Span full width for rows with special layout */
.categories-grid .card-wide {
    grid-column: span 2;
}

/* Three-column row */
.categories-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

/* --- Search Modal --- */
.search-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    z-index: 2000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

.search-modal-overlay.active {
    display: flex;
}

.search-modal {
    background: var(--bg-card);
    border-radius: 16px;
    width: 90%;
    max-width: 620px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.search-modal-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.search-modal-header .search-icon {
    color: var(--text-muted);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.search-modal-input {
    flex: 1;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 1.05rem;
    background: transparent;
    color: var(--text-primary);
}

.search-modal-input::placeholder {
    color: var(--text-muted);
}

.search-modal-close {
    background: var(--kbd-bg);
    border: 1px solid var(--kbd-border);
    border-radius: 4px;
    padding: 2px 8px;
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
}

.search-modal-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px 0;
}

.search-result-item {
    display: block;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.15s;
}

.search-result-item:hover,
.search-result-item.active {
    background: var(--accent-teal-light);
    color: var(--text-primary);
}

.search-result-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.search-result-snippet {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.search-result-category {
    font-size: 0.75rem;
    color: var(--accent-teal);
    margin-top: 2px;
}

.search-no-results {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- Category Page Layout --- */
.page-layout {
    display: flex;
    gap: 32px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Sidebar */
.page-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 92px;
    align-self: flex-start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li a {
    display: block;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    border-radius: 0 6px 6px 0;
    transition: all 0.2s;
}

.sidebar-nav li a:hover {
    color: var(--accent-teal);
    background: var(--accent-teal-light);
    border-left-color: var(--accent-teal);
}

.sidebar-nav li a.active {
    color: var(--accent-teal);
    background: var(--accent-teal-light);
    border-left-color: var(--accent-teal);
    font-weight: 700;
}

.sidebar-section-title {
    padding: 10px 16px 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Page Content */
.page-content {
    flex: 1;
    min-width: 0;
}

.page-content h1 {
    margin-bottom: 8px;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.breadcrumbs a {
    color: var(--text-muted);
}

.breadcrumbs a:hover {
    color: var(--accent-teal);
}

.breadcrumbs .separator {
    font-size: 0.7rem;
}

/* --- Content Styling (for help articles) --- */
.article-content {
    line-height: 1.75;
}

.article-content h2 {
    margin-top: 32px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.article-content h3 {
    margin-top: 24px;
    margin-bottom: 8px;
}

.article-content p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.article-content ul,
.article-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.article-content code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.article-content kbd {
    display: inline-block;
    background: var(--kbd-bg);
    border: 1px solid var(--kbd-border);
    border-radius: 4px;
    padding: 1px 7px;
    font-family: inherit;
    font-size: 0.85em;
    font-weight: 700;
    color: var(--text-primary);
    box-shadow: 0 1px 0 var(--kbd-border);
    line-height: 1.6;
    vertical-align: baseline;
}

.article-content img {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin: 16px 0;
}

.article-content .footnote {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: italic;
}

/* Info/Tip/Warning boxes */
.callout {
    padding: 16px 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid;
    font-size: 0.95rem;
}

.callout-info {
    background: rgba(66, 153, 225, 0.08);
    border-left-color: #4299e1;
}

.callout-tip {
    background: rgba(72, 187, 120, 0.08);
    border-left-color: #48bb78;
}

.callout-warning {
    background: rgba(237, 137, 54, 0.08);
    border-left-color: #ed8936;
}

.callout-title {
    font-weight: 700;
    margin-bottom: 4px;
}

/* --- Footer --- */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 24px;
    text-align: center;
    font-size: 0.85rem;
    margin-top: auto;
}

.footer a {
    color: var(--accent-teal);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .categories-row-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Nav */
    .nav-tabs {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-nav);
        flex-direction: column;
        padding: 8px 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        gap: 0;
    }

    .nav-tabs.open {
        display: flex;
    }

    .nav-tabs li a {
        padding: 12px 24px;
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    .nav-tabs li a.active {
        border-bottom: none;
        border-left-color: var(--accent-teal);
    }

    .nav-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Hero */
    .hero {
        padding: 32px 16px;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    /* Cards */
    .categories-grid {
        grid-template-columns: 1fr;
    }

    .categories-row-3 {
        grid-template-columns: 1fr;
    }

    .categories-grid .card-wide {
        grid-column: span 1;
    }

    /* Welcome banner */
    .welcome-banner {
        flex-direction: column;
        text-align: center;
    }

    /* Page layout */
    .page-layout {
        flex-direction: column;
        padding: 20px 16px;
    }

    .page-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 16px;
        margin-bottom: 16px;
    }

    /* Support button - hide label on mobile */
    .nav-support-btn .support-label {
        display: none;
    }

    .nav-support-btn {
        width: 38px;
        padding: 0;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.3rem;
    }

    .search-input {
        padding: 12px 60px 12px 42px;
        font-size: 0.9rem;
    }

    .navbar-inner {
        padding: 0 16px;
    }

    .category-card {
        padding: 18px;
    }
}

/* --- Icon Actions Grid (Customer toolbar icons) --- */
.icon-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin: 20px 0 24px;
}

.icon-action-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.icon-action-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--accent-teal);
}

.icon-action-item img {
    flex-shrink: 0;
    max-height: 42px;
    width: auto;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 4px;
    margin: 0;
}

.icon-action-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.icon-action-desc strong {
    color: var(--text-primary);
    font-size: 0.95rem;
    display: block;
    margin-bottom: 2px;
}

.article-content h4 {
    margin-top: 28px;
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--accent-teal);
}

@media (max-width: 768px) {
    .icon-actions-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Utilities --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Back to Top Button --- */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 900;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--accent-teal);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(24, 180, 170, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #15a098;
    box-shadow: 0 4px 18px rgba(24, 180, 170, 0.5);
    transform: translateY(-2px);
}

.back-to-top:active {
    transform: translateY(0);
}

.back-to-top svg {
    width: 22px;
    height: 22px;
    pointer-events: none;
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }

    .back-to-top svg {
        width: 20px;
        height: 20px;
    }
}

/* Smooth transition for theme switch */
body,
.navbar,
.category-card,
.search-input,
.page-sidebar,
.footer {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
