/**
 * TGC Forum Styles
 * Modern, responsive forum styling with TGC brand colors
 */

:root {
    --tgc-primary: #214251;
    --tgc-sage: #679436;
    --tgc-blue: #05668d;
    --tgc-purple: #8B89BA;
    --tgc-light: #BEDEDA;
    --tgc-dark: #1f1f1f;
    --tgc-gray: #f4f4f4;
    --tgc-border: #e0e0e0;
}

/* Container */
.tgc-forum-container {
    max-width: 1200px;
    margin: 2.5rem auto;
    padding: 0 1.25rem;
}

/* Header */
.tgc-forum-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.875rem;
    border-bottom: 2px solid var(--tgc-sage);
}

.tgc-forum-header h1 {
    color: var(--tgc-primary);
    margin-bottom: 0.625rem;
}

.tgc-forum-user-actions {
    display: flex;
    gap: 0.9375rem;
    justify-content: center;
    margin-top: 1.25rem;
}

.tgc-forum-guest-message {
    background: var(--tgc-gray);
    padding: 0.9375rem;
    border-radius: 0.5rem;
    margin-top: 1.25rem;
}

/* Buttons */
.tgc-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-family: 'National Park', 'Arial', sans-serif;
    text-decoration: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.tgc-btn-primary {
    background: var(--tgc-sage);
    color: white;
}

.tgc-btn-primary:hover {
    background: #a5be00;
}

.tgc-btn-secondary {
    background: var(--tgc-blue);
    color: white;
}

.tgc-btn-secondary:hover {
    background: #427aa1;
}

.tgc-btn-danger {
    background: #d32f2f;
    color: white;
}

.tgc-btn-danger:hover {
    background: #b71c1c;
}

.tgc-btn-small {
    padding: 0.3125rem 0.75rem;
    font-size: 0.8125rem;
}

.tgc-btn-back {
    background: #efefef;
    color: #333;
    border: 1px solid #ddd;
}

.tgc-btn-back:hover {
    background: #e0e0e0;
    color: #333;
}

/* Category Cards */
.tgc-forum-categories {
    display: grid;
    gap: 1.25rem;
}

.tgc-forum-category-card {
    display: grid;
    grid-template-columns: 60px 1fr auto auto;
    gap: 1.25rem;
    align-items: center;
    background: white;
    border: 1px solid var(--tgc-border);
    border-radius: 0.5rem;
    padding: 1.25rem;
    transition: box-shadow 0.3s ease;
}

.tgc-forum-category-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-icon {
    font-size: 2.25rem;
    color: var(--tgc-sage);
}

.category-info h3 {
    margin: 0 0 0.625rem;
    font-size: 1.25rem;
}

.category-info h3 a {
    color: var(--tgc-primary);
    text-decoration: none;
}

.category-info h3 a:hover {
    color: var(--tgc-sage);
}

.category-info p {
    margin: 0;
    color: #666;
    font-size: 0.875rem;
}

.category-stats {
    display: flex;
    gap: 1.25rem;
}

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

.stat-item strong {
    display: block;
    font-size: 1.5rem;
    color: var(--tgc-primary);
}

.stat-item span {
    font-size: 0.75rem;
    color: #777;
}

.category-latest {
    min-width: 250px;
}

.latest-topic a {
    color: var(--tgc-primary);
    font-weight: 600;
    text-decoration: none;
}

.latest-topic a:hover {
    text-decoration: underline;
}

.latest-topic small {
    display: block;
    color: #999;
    margin-top: 0.3125rem;
}

.no-activity {
    color: #999;
    font-style: italic;
}

/* Badges */
.tgc-badge {
    display: inline-block;
    padding: 0.1875rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: bold;
    border-radius: 0.1875rem;
    margin-left: 0.625rem;
}

.tgc-badge-premium {
    background: var(--tgc-purple);
    color: white;
}

/* Post Display */
.tgc-forum-post {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1.25rem;
    background: white;
    border: 1px solid var(--tgc-border);
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.tgc-forum-original-post {
    border-left: 4px solid var(--tgc-sage);
}

.post-author {
    text-align: center;
}

.tgc-forum-userbox {
    background: var(--tgc-gray);
    padding: 0.9375rem;
    border-radius: 0.5rem;
}

.user-avatar img {
    border-radius: 50%;
    margin-bottom: 0.625rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.user-name {
    font-weight: bold;
    color: var(--tgc-primary);
    margin-bottom: 0.3125rem;
}

.user-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    color: white;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    margin: 0.3125rem 0;
}

.user-stats {
    margin-top: 0.625rem;
    font-size: 0.75rem;
    color: #666;
}

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

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--tgc-border);
    margin-bottom: 0.9375rem;
}

.post-date {
    color: #999;
    font-size: 0.8125rem;
}

.post-actions {
    display: flex;
    gap: 0.625rem;
}

.post-actions button {
    background: none;
    border: 1px solid var(--tgc-border);
    padding: 0.3125rem 0.625rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.75rem;
}

.post-actions button:hover {
    background: var(--tgc-gray);
}

.post-body {
    line-height: 1.8;
}

.post-signature {
    margin-top: 1.25rem;
    padding-top: 0.9375rem;
    border-top: 1px dashed var(--tgc-border);
    font-size: 0.8125rem;
    color: #666;
    font-style: italic;
}

/* Dashboard */
.tgc-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.875rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--tgc-border);
    border-radius: 0.5rem;
    padding: 1.25rem;
    text-align: center;
}

.stat-card h3 {
    margin: 0;
    color: var(--tgc-primary);
    font-size: 1.75rem;
}

.stat-card p {
    margin: 0.625rem 0 0;
    color: #777;
}

.tgc-dashboard-tabs {
    display: flex;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--tgc-border);
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tab-btn.active {
    border-bottom-color: var(--tgc-sage);
    color: var(--tgc-sage);
}

.tgc-tab-content {
    display: none;
}

.tgc-tab-content.active {
    display: block;
}

/* Forms */
.tgc-form-group {
    margin-bottom: 1.25rem;
}

.tgc-form-group label {
    display: block;
    margin-bottom: 0.3125rem;
    font-weight: 600;
}

.tgc-form-group input[type="text"],
.tgc-form-group input[type="email"],
.tgc-form-group input[type="password"],
.tgc-form-group textarea,
.tgc-form-group select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--tgc-border);
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.tgc-form-group small {
    display: block;
    margin-top: 0.3125rem;
    color: #777;
    font-size: 0.75rem;
}

.required {
    color: #d32f2f;
}

/* Tables */
.tgc-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.tgc-table th,
.tgc-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--tgc-border);
}

.tgc-table th {
    background: var(--tgc-gray);
    font-weight: 600;
}

/* Notices */
.tgc-notice {
    padding: 0.9375rem;
    border-radius: 0.25rem;
    margin: 1.25rem 0;
}

.tgc-notice-success {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    color: #2e7d32;
}

.tgc-notice-error {
    background: #ffebee;
    border-left: 4px solid #f44336;
    color: #c62828;
}

.tgc-notice-warning {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    color: #e65100;
}

.tgc-notice-info {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    color: #1565c0;
}

/* Pagination */
.tgc-forum-pagination {
    display: flex;
    gap: 0.3125rem;
    justify-content: center;
    margin: 1.875rem 0;
}

.tgc-forum-pagination a {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--tgc-border);
    border-radius: 0.25rem;
    text-decoration: none;
    color: var(--tgc-primary);
}

.tgc-forum-pagination a:hover {
    background: var(--tgc-gray);
}

.tgc-forum-pagination a.active {
    background: var(--tgc-sage);
    color: white;
    border-color: var(--tgc-sage);
}

/* Breadcrumbs */
.tgc-forum-breadcrumbs {
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
}

.tgc-forum-breadcrumbs a {
    color: var(--tgc-blue);
    text-decoration: none;
}

.tgc-forum-breadcrumbs a:hover {
    text-decoration: underline;
}

/* Locked category card */
.category-locked {
    opacity: 0.7;
    background: #f9f9f9 !important;
    cursor: default;
    pointer-events: none;
}
.category-locked a {
    pointer-events: auto;
}

.category-locked .category-icon .dashicons {
    color: #bbb;
}

/* User profile card modal */
#tgc-user-card-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tgc-ucard-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}

.tgc-ucard-box {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 340px;
    margin: 16px;
    overflow: hidden;
}

.tgc-ucard-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #888;
    cursor: pointer;
    line-height: 1;
    z-index: 2;
}

.tgc-ucard-close:hover { color: #333; }

.tgc-ucard-content {
    padding: 28px 24px 24px;
    text-align: center;
}

.tgc-ucard-avatar {
    margin-bottom: 14px;
}

.tgc-ucard-avatar img {
    width: 72px !important;
    height: 72px !important;
    border-radius: 50% !important;
    object-fit: cover;
    border: 3px solid var(--tgc-light);
    display: block;
    margin: 0 auto;
}

.tgc-ucard-info {
    margin-bottom: 16px;
}

.tgc-ucard-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--tgc-primary);
    margin-bottom: 2px;
}

.tgc-ucard-username {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 8px;
}

.tgc-ucard-role {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--tgc-sage);
    color: #fff;
}

.tgc-ucard-stats {
    display: flex;
    gap: 24px;
    justify-content: center;
    padding: 16px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 16px;
}

.tgc-ucard-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.tgc-ucard-stat strong {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--tgc-primary);
}

.tgc-ucard-stat span {
    font-size: 0.72rem;
    color: #999;
    text-transform: uppercase;
}

.tgc-ucard-footer {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tgc-ucard-msg-btn {
    display: inline-block;
    background: var(--tgc-blue);
    color: #fff;
    padding: 9px 24px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.tgc-ucard-msg-btn:hover {
    background: var(--tgc-primary);
    color: #fff;
}

.tgc-ucard-mute-btn {
    display: inline-block;
    background: #f0f0f0;
    color: #555;
    border: 1px solid #ccc;
    padding: 9px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.tgc-ucard-mute-btn:hover,
.tgc-ucard-mute-btn.tgc-muted-active {
    background: #e67e22;
    color: #fff;
    border-color: #e67e22;
}

/* Make user names in forum posts clickable */
.tgc-forum-userbox .user-name {
    cursor: pointer;
    text-decoration: underline dotted;
}

.tgc-forum-userbox .user-name:hover {
    color: var(--tgc-blue);
}

/* Responsive */
@media (max-width: 770px) {
    .tgc-forum-category-card {
        grid-template-columns: 40px 1fr auto;
        grid-template-areas:
            "icon info stats"
            "icon desc desc";
        gap: 0.5rem;
        padding: 1rem;
        align-items: center;
    }

    .category-icon {
        grid-area: icon;
        font-size: 1.8rem;
        align-self: start;
        margin-top: 5px;
    }

    .category-info {
        display: contents; /* Allows h3 and p to act as grid items */
    }

    .category-info h3 {
        grid-area: info;
        font-size: 1.1rem;
        margin: 0;
    }

    .category-info p {
        grid-area: desc;
        display: block;
        font-size: 0.85rem;
        color: #666;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
    }

    .category-stats {
        grid-area: stats;
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: 5px;
    }

    .stat-item {
        display: inline-flex;
        flex-direction: row;
        align-items: baseline;
        gap: 3px;
        text-align: right;
    }

    .stat-item strong {
        display: inline;
        font-size: 0.85rem;
    }

    .stat-item span {
        font-size: 0.85rem;
    }

    .category-stats .stat-item:first-child::after {
        content: " |";
        color: #ccc;
        margin-left: 2px;
    }

    .category-latest {
        display: none;
        /* Hide latest topic on mobile */
    }

    .tgc-forum-post {
        grid-template-columns: 1fr;
    }

    .tgc-forum-user-actions {
        flex-direction: column;
        align-items: center;
    }

    .tgc-forum-grid {
        grid-template-columns: 1fr !important;
    }
}