/* ========================================
   MARKSY - Knowledge Hub Styles
   ======================================== */

/* ========================================
   Hub Hero
   ======================================== */

.hub-hero {
    background: linear-gradient(135deg, var(--navy) 0%, #1E3A5F 100%);
    padding: var(--space-3xl) 0;
    position: relative;
    overflow: hidden;
}

.hub-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(0, 166, 156, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 198, 177, 0.1) 0%, transparent 40%);
}

.hub-hero__content {
    position: relative;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.hub-hero__badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(0, 166, 156, 0.2);
    border: 1px solid rgba(0, 166, 156, 0.3);
    border-radius: 50px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--turquoise);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-md);
}

.hub-hero h1 {
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: var(--space-md);
    line-height: 1.2;
}

.hub-hero p {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--space-xl);
}

/* Hub Search */
.hub-search {
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-sm);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    margin: 0 auto var(--space-2xl);
}

.hub-search svg {
    width: 24px;
    height: 24px;
    color: var(--gray-400);
    margin: 0 var(--space-md);
    flex-shrink: 0;
}

.hub-search input {
    flex: 1;
    border: none;
    font-size: 1rem;
    padding: var(--space-sm);
    outline: none;
}

.hub-search__btn {
    padding: var(--space-sm) var(--space-xl);
    background: var(--teal);
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.hub-search__btn:hover {
    background: var(--teal-dark);
}

/* Hub Stats */
.hub-hero__stats {
    display: flex;
    justify-content: center;
    gap: var(--space-2xl);
}

.hub-stat {
    text-align: center;
}

.hub-stat__value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 2px;
}

.hub-stat__label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 640px) {
    .hub-hero h1 {
        font-size: 1.75rem;
    }
    
    .hub-search {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .hub-search svg {
        display: none;
    }
    
    .hub-search input {
        width: 100%;
        text-align: center;
    }
    
    .hub-search__btn {
        width: 100%;
    }
    
    .hub-hero__stats {
        gap: var(--space-xl);
    }
    
    .hub-stat__value {
        font-size: 1.5rem;
    }
}

/* ========================================
   Featured Guides
   ======================================== */

.featured-guides {
    padding: var(--space-3xl) 0;
    background: var(--white);
}

.featured-guides__header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.featured-guides__header h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: var(--space-xs);
}

.featured-guides__header p {
    color: var(--gray-500);
}

.featured-guides__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: var(--space-lg);
}

/* Featured Card */
.featured-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.featured-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.featured-card--large {
    grid-row: span 2;
}

.featured-card__image {
    height: 160px;
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.featured-card--large .featured-card__image {
    height: 100%;
    min-height: 280px;
}

.featured-card__image--copyright {
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
}

.featured-card__image--patent {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

.featured-card__icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.featured-card--large .featured-card__icon {
    width: 100px;
    height: 100px;
}

.featured-card__icon svg {
    width: 40px;
    height: 40px;
    color: var(--white);
}

.featured-card--large .featured-card__icon svg {
    width: 50px;
    height: 50px;
}

.featured-card__content {
    padding: var(--space-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.featured-card__category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--teal);
    margin-bottom: var(--space-sm);
}

.featured-card__content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: var(--space-sm);
    line-height: 1.4;
}

.featured-card--large .featured-card__content h3 {
    font-size: 1.375rem;
}

.featured-card__content p {
    font-size: 0.875rem;
    color: var(--gray-500);
    line-height: 1.6;
    flex: 1;
}

.featured-card__meta {
    display: flex;
    gap: var(--space-lg);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--gray-100);
}

.featured-card__meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--gray-400);
}

.featured-card__meta svg {
    width: 14px;
    height: 14px;
}

@media (max-width: 768px) {
    .featured-guides__grid {
        grid-template-columns: 1fr;
    }
    
    .featured-card--large {
        grid-row: span 1;
    }
    
    .featured-card--large .featured-card__image {
        min-height: 160px;
    }
}

/* ========================================
   Hub Main Layout
   ======================================== */

.hub-main {
    padding: var(--space-3xl) 0;
    background: var(--gray-50);
}

.hub-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--space-2xl);
    align-items: start;
}

@media (max-width: 1024px) {
    .hub-layout {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Hub Sidebar
   ======================================== */

.hub-sidebar {
    position: sticky;
    top: 100px;
}

@media (max-width: 1024px) {
    .hub-sidebar {
        position: static;
    }
}

.hub-sidebar__sticky {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

/* Filter Section */
.filter-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

.filter-section h3 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    margin-bottom: var(--space-md);
}

/* Topic List */
.topic-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}

.topic-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: none;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--gray-600);
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
}

.topic-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}

.topic-item:hover {
    background: var(--gray-50);
    color: var(--navy);
}

.topic-item.active {
    background: rgba(0, 166, 156, 0.1);
    color: var(--teal);
}

.topic-item.active svg {
    opacity: 1;
}

.topic-count {
    margin-left: auto;
    padding: 2px 8px;
    background: var(--gray-100);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
}

.topic-item.active .topic-count {
    background: var(--teal);
    color: var(--white);
}

/* Type Filters */
.type-filters {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.type-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.type-checkbox:hover {
    background: var(--gray-100);
}

.type-checkbox input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray-300);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.type-checkbox input:checked + .checkmark {
    background: var(--teal);
    border-color: var(--teal);
}

.type-checkbox input:checked + .checkmark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.type-label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex: 1;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.type-label svg {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

.type-count {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* Level Filters */
.level-filters {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.level-radio {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.level-radio input {
    display: none;
}

.radio-mark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.level-radio input:checked + .radio-mark {
    border-color: var(--teal);
}

.level-radio input:checked + .radio-mark::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--teal);
    border-radius: 50%;
}

/* Newsletter Card */
.newsletter-card {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    text-align: center;
    color: var(--white);
}

.newsletter-card__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    margin: 0 auto var(--space-md);
}

.newsletter-card__icon svg {
    width: 24px;
    height: 24px;
}

.newsletter-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.newsletter-card p {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: var(--space-md);
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.newsletter-form input {
    padding: var(--space-sm) var(--space-md);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.newsletter-form input:focus {
    outline: 2px solid var(--teal);
}

.newsletter-form .btn {
    width: 100%;
}

@media (max-width: 1024px) {
    .newsletter-card {
        display: none;
    }
    
    .topic-list {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-xs);
        max-height: none;
    }
    
    .topic-item {
        padding: var(--space-xs) var(--space-md);
        border: 1px solid var(--gray-200);
        border-radius: var(--radius-lg);
        margin-bottom: 0;
    }
    
    .topic-item svg {
        display: none;
    }
    
    .topic-item.active {
        border-color: var(--teal);
    }
    
    .type-filters,
    .level-filters {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* ========================================
   Hub Content
   ======================================== */

.hub-content {
    min-width: 0;
}

/* Results Header */
.hub-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--gray-200);
}

.hub-results-info {
    font-size: 0.9375rem;
    color: var(--gray-600);
}

.hub-results-topic {
    font-weight: 600;
    color: var(--navy);
}

.hub-view-options {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

/* View Toggle */
.view-toggle {
    display: flex;
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 4px;
    box-shadow: var(--shadow-sm);
}

.view-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--gray-400);
    transition: all var(--transition-fast);
}

.view-btn svg {
    width: 18px;
    height: 18px;
}

.view-btn:hover {
    color: var(--gray-600);
}

.view-btn.active {
    background: var(--teal);
    color: var(--white);
}

/* Sort */
.hub-sort {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.hub-sort label {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.hub-sort select {
    padding: var(--space-xs) var(--space-md);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: var(--white);
    cursor: pointer;
}

.hub-sort select:focus {
    outline: none;
    border-color: var(--teal);
}

@media (max-width: 640px) {
    .hub-results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .hub-view-options {
        width: 100%;
        justify-content: space-between;
    }
}

/* ========================================
   Articles Grid
   ======================================== */

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.articles-grid.list-view {
    grid-template-columns: 1fr;
}

/* Article Card */
.article-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.article-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.article-card.hidden {
    display: none;
}

.article-card__image {
    height: 140px;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: var(--space-md);
}

.article-card__type {
    padding: 4px 10px;
    background: var(--white);
    border-radius: 50px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-600);
}

.article-card__level {
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.6875rem;
    font-weight: 600;
}

.article-card__level--beginner {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.article-card__level--intermediate {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.article-card__level--advanced {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.article-card__content {
    padding: var(--space-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-card__topic {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--teal);
    margin-bottom: var(--space-sm);
}

.article-card__content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    line-height: 1.4;
}

.article-card__content h3 a {
    color: var(--navy);
    transition: color var(--transition-fast);
}

.article-card__content h3 a:hover {
    color: var(--teal);
}

.article-card__content p {
    font-size: 0.875rem;
    color: var(--gray-500);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card__meta {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--gray-100);
}

.article-card__time,
.article-card__views {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8125rem;
    color: var(--gray-400);
}

.article-card__time svg,
.article-card__views svg {
    width: 14px;
    height: 14px;
}

/* List View */
.articles-grid.list-view .article-card {
    flex-direction: row;
}

.articles-grid.list-view .article-card__image {
    width: 200px;
    height: auto;
    min-height: 160px;
    flex-shrink: 0;
}

.articles-grid.list-view .article-card__content p {
    -webkit-line-clamp: 3;
}

@media (max-width: 768px) {
    .articles-grid.list-view .article-card {
        flex-direction: column;
    }
    
    .articles-grid.list-view .article-card__image {
        width: 100%;
        height: 140px;
        min-height: auto;
    }
}

@media (max-width: 640px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   No Results
   ======================================== */

.hub-no-results {
    text-align: center;
    padding: var(--space-3xl);
    background: var(--white);
    border-radius: var(--radius-xl);
}

.hub-no-results svg {
    width: 64px;
    height: 64px;
    color: var(--gray-300);
    margin-bottom: var(--space-lg);
}

.hub-no-results h3 {
    font-size: 1.25rem;
    color: var(--navy);
    margin-bottom: var(--space-sm);
}

.hub-no-results p {
    color: var(--gray-500);
    margin-bottom: var(--space-lg);
}

/* ========================================
   Pagination
   ======================================== */

.hub-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--gray-200);
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn svg {
    width: 16px;
    height: 16px;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-pages {
    display: flex;
    gap: var(--space-xs);
}

.pagination-page {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-page:hover:not(.active) {
    background: var(--gray-50);
}

.pagination-page.active {
    background: var(--teal);
    border-color: var(--teal);
    color: var(--white);
}

.pagination-page.ellipsis {
    cursor: default;
    pointer-events: none;
}

@media (max-width: 640px) {
    .hub-pagination {
        flex-direction: column;
        gap: var(--space-md);
    }
}

/* ========================================
   CTA Section
   ======================================== */

.hub-cta {
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
    padding: var(--space-3xl) 0;
}

.hub-cta__content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.hub-cta h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: var(--space-sm);
}

.hub-cta p {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--space-xl);
}

.hub-cta__actions {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
}

.btn--white {
    background: var(--white);
    color: var(--teal);
    border: 2px solid var(--white);
}

.btn--white:hover {
    background: transparent;
    color: var(--white);
}

.btn--outline-white {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn--outline-white:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--white);
}

@media (max-width: 640px) {
    .hub-cta__actions {
        flex-direction: column;
    }
}
