/* ==========================================================================
   TravelyData KB - Elementor Pro Widgets CSS (Tikidocs Inspired)
   ========================================================================== */

/* Variables */
:root {
    --td-primary: #0052FF;
    --td-primary-hover: #0043D1;
    --td-text-dark: #1F2937;
    --td-text-light: #6B7280;
    --td-bg-light: #F9FAFB;
    --td-border: #E5E7EB;
    --td-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --td-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --td-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --td-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 1. Hero Search Widget */
.td-kb-hero-search {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--td-bg-light);
    border-radius: 16px;
    margin-bottom: 40px;
}

.td-kb-hero-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--td-text-dark);
    margin-bottom: 12px;
}

.td-kb-hero-subtitle {
    font-size: 18px;
    color: var(--td-text-light);
    margin-bottom: 32px;
}

.td-search-wrapper.pro-search {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    background: #fff;
    border-radius: 50px;
    box-shadow: var(--td-shadow-md);
    transition: box-shadow 0.3s ease;
}

.td-search-wrapper.pro-search:focus-within {
    box-shadow: var(--td-shadow-lg);
    border: 1px solid var(--td-primary);
}

.td-search-wrapper.pro-search .td-search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
}

.td-search-wrapper.pro-search .td-search-input {
    width: 100%;
    padding: 20px 20px 20px 56px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    outline: none;
    background: transparent;
    color: var(--td-text-dark);
}

.td-search-wrapper.pro-search .td-search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--td-shadow-lg);
    z-index: 99;
    text-align: left;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--td-border);
}

/* 2. Categories Grid Widget */
.td-kb-categories-grid {
    display: grid;
    gap: 24px;
}

.td-kb-categories-grid.td-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.td-kb-categories-grid.td-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.td-kb-categories-grid.td-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
    .td-kb-categories-grid.td-grid-cols-3,
    .td-kb-categories-grid.td-grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .td-kb-categories-grid[class*="td-grid-cols-"] { grid-template-columns: 1fr; }
}

.td-kb-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--td-border);
    text-decoration: none;
    box-shadow: var(--td-shadow-sm);
    transition: all 0.3s ease;
}

.td-kb-category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--td-shadow-hover);
    border-color: transparent;
}

.td-cat-icon {
    width: 64px;
    height: 64px;
    background: rgba(0, 82, 255, 0.1);
    color: var(--td-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.td-kb-category-card:hover .td-cat-icon {
    background: var(--td-primary);
    color: #fff;
}

.td-cat-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--td-text-dark);
    margin: 0 0 8px 0;
}

.td-cat-count {
    font-size: 14px;
    color: var(--td-text-light);
    font-weight: 500;
}

/* 3. Sidebar Widget */
.td-kb-pro-sidebar {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--td-border);
}

.td-sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--td-text-dark);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--td-border);
}

.td-pro-menu-group {
    margin-bottom: 12px;
}

.td-pro-menu-category {
    font-size: 15px;
    font-weight: 600;
    color: var(--td-text-dark);
    margin: 0;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.td-pro-menu-category:hover,
.td-pro-menu-category.active {
    background: var(--td-bg-light);
    color: var(--td-primary);
}

.td-pro-menu-posts {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 16px;
    border-left: 1px solid var(--td-border);
}

.td-pro-menu-posts li {
    margin-bottom: 4px;
}

.td-pro-post-link {
    display: block;
    padding: 6px 12px;
    font-size: 14px;
    color: var(--td-text-light);
    text-decoration: none;
    border-radius: 0 6px 6px 0;
    border-left: 2px solid transparent;
    margin-left: -1px;
    transition: all 0.2s;
}

.td-pro-post-link:hover,
.td-pro-post-link.current {
    color: var(--td-primary);
    background: rgba(0, 82, 255, 0.05);
    border-left-color: var(--td-primary);
}

/* Ensure existing search results style nicely in pro context */
.td-search-result-item {
    padding: 12px 20px;
    display: block;
    text-decoration: none;
    color: var(--td-text-dark);
    border-bottom: 1px solid var(--td-border);
}
.td-search-result-item:last-child {
    border-bottom: none;
}
.td-search-result-item:hover {
    background: var(--td-bg-light);
    color: var(--td-primary);
}
