/**
 * PCBuildMate Forum Styles
 * Base layout, page structure, and index page
 */

/* ============================================
   FORUM INDEX
   ============================================ */

.forum-index {
    padding: clamp(1.5rem, 3vw, 2rem) 0 clamp(3rem, 6vw, 5rem);
    background: var(--bg-primary);
    min-height: calc(100vh - 64px);
}

/* ============================================
   FORUM PAGE HEADER
   Consistent with site-wide page-header pattern
   ============================================ */

.forum-header {
    display: flex;
    flex-direction: column;
    gap: clamp(0.5rem, 1vw, 0.75rem);
    padding-bottom: clamp(1rem, 2vw, 1.25rem);
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
    border-bottom: 2px solid var(--accent);
}

.forum-header h1,
.forum-title {
    font-size: clamp(1.625rem, 3vw + 0.25rem, 2.25rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.forum-description {
    font-size: clamp(0.9375rem, 1.5vw + 0.25rem, 1.0625rem);
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
    max-width: 700px;
}

/* ============================================
   FORUM ACTIONS BAR
   ============================================ */

.forum-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: clamp(1rem, 2vw, 1.5rem);
    padding: clamp(0.75rem, 1.5vw, 1rem) 0;
    margin-bottom: clamp(1.25rem, 2.5vw, 1.5rem);
    border-bottom: 1px solid var(--border);
}

/* ============================================
   SEARCH INPUT
   ============================================ */

.forum-search {
    flex: 1;
    max-width: 400px;
}

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

.search-input-wrapper input {
    width: 100%;
    padding: clamp(0.5rem, 1vw, 0.625rem) 1rem clamp(0.5rem, 1vw, 0.625rem) 2.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: clamp(0.875rem, 1.5vw + 0.25rem, 0.9375rem);
    transition: all 0.2s ease;
}

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

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

.search-input-wrapper svg {
    position: absolute;
    left: 1rem;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

/* ============================================
   FORUM SEARCH BAR COMPONENT
   ============================================ */

.forum-search-bar {
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.search-form-wrapper {
    display: flex;
    gap: clamp(0.75rem, 1.5vw, 1rem);
    align-items: center;
}

.search-input-group {
    flex: 1;
    min-width: 0;
}

/* Ensure input takes full height */
.search-input-group .search-input-wrapper {
    height: 44px;
}

.search-input-group .search-input-wrapper input {
    height: 44px;
    padding-top: 0;
    padding-bottom: 0;
}

.search-filter-group {
    flex-shrink: 0;
    min-width: 180px;
}

.search-filter-group .filter-select {
    width: 100%;
    height: 44px;
}

.search-submit {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 44px;
    padding: 0 clamp(1rem, 2vw, 1.5rem);
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: var(--radius-md);
    font-size: clamp(0.875rem, 1.5vw + 0.25rem, 0.9375rem);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.search-submit:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.search-submit:active {
    transform: translateY(0);
}

.search-submit svg {
    width: 18px;
    height: 18px;
}

.search-submit-text {
    display: inline;
}

/* ============================================
   CATEGORIES SECTION
   ============================================ */

.forum-categories {
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.forum-category-group {
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.forum-category-group:last-child {
    margin-bottom: 0;
}

.forum-category-group h2,
.category-group-title {
    font-size: clamp(1.125rem, 2vw + 0.25rem, 1.25rem);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 clamp(0.75rem, 1.5vw, 1rem) 0;
    padding-bottom: clamp(0.375rem, 0.75vw, 0.5rem);
    border-bottom: 2px solid var(--border);
}

.forum-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: clamp(0.75rem, 1.5vw, 1rem);
}

/* ============================================
   SECTION TITLES
   ============================================ */

.section-title {
    font-size: clamp(1.25rem, 2vw + 0.5rem, 1.5rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 clamp(1rem, 2vw, 1.25rem) 0;
    padding-bottom: clamp(0.5rem, 1vw, 0.75rem);
    border-bottom: 2px solid var(--border);
}

/* Section title with accent underline (optional modifier) */
.section-title--accent {
    border-bottom-color: var(--accent);
}

/* ============================================
   NEW TOPIC BUTTON (Primary CTA)
   ============================================ */

.forum-new-topic-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: clamp(0.625rem, 1.25vw, 0.75rem) clamp(1rem, 2vw, 1.5rem);
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: var(--radius-md);
    font-size: clamp(0.875rem, 1.5vw + 0.25rem, 0.9375rem);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    min-height: 44px;
}

.forum-new-topic-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

.forum-new-topic-btn:active {
    transform: translateY(0);
}

.forum-new-topic-btn svg {
    width: 18px;
    height: 18px;
}

/* Secondary button variant */
.forum-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: clamp(0.625rem, 1.25vw, 0.75rem) clamp(1rem, 2vw, 1.5rem);
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: clamp(0.875rem, 1.5vw + 0.25rem, 0.9375rem);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    min-height: 44px;
}

.forum-btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
}

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