/* --- GENERAL --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --ic-primary: #5a7dbe; /* Softer blue */
    --ic-secondary: #4CAF50; /* Vibrant green */
    --ic-text: #212121; /* Darker for better contrast */
    --ic-text-light: #757575; /* Slightly darker light text */
    --ic-background: #f0f2f5; /* Slightly off-white for a softer look */
    --ic-white: #ffffff;
    --ic-border-color: #e0e0e0; /* Lighter border */
    --ic-shadow-color: rgba(0, 0, 0, 0.08); /* More diffused shadow */
    --ic-success: #4CAF50;
    --ic-error: #f44336;
    --ic-radius: 12px;
}

.ic-forums-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 20px;
    background: var(--ic-background);
    font-family: 'Inter', sans-serif;
    color: var(--ic-text);
}

/* --- HEADER --- */
.ic-forums-header {
    background: var(--ic-white);
    padding: 2rem;
    border-radius: var(--ic-radius);
    margin-bottom: 2rem;
    box-shadow: 0 15px 30px -10px var(--ic-shadow-color); /* More pronounced shadow */
}

.ic-forums-header h1 {
    margin: 0;
    color: var(--ic-primary);
    font-size: 2.5rem;
    font-weight: 700;
}

/* --- BUTTONS & FORMS --- */
.ic-forums-create-section {
    background: var(--ic-white);
    padding: 1.5rem;
    border-radius: var(--ic-radius);
    margin-bottom: 2rem;
    box-shadow: 0 8px 15px -5px var(--ic-shadow-color); /* More pronounced shadow */
}

.ic-form-container {
    margin-top: 1.5rem;
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease-in-out;
}

.ic-form-container > div {
    overflow: hidden;
}

.ic-form-container.ic-form-open {
    grid-template-rows: 1fr;
}

.ic-form-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 1.5rem;
}

.ic-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease; /* Smoother transition */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ic-btn .dashicons {
    margin-right: 8px;
    vertical-align: middle;
}

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

.ic-btn-primary:hover {
    background: #4a6a9e; /* Slightly darker primary on hover */
    transform: translateY(-3px); /* More pronounced lift */
    box-shadow: 0 8px 16px rgba(90, 125, 190, 0.4); /* Enhanced shadow on hover */
}

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

.ic-btn-secondary:hover {
    background: #43a047; /* Slightly darker secondary on hover */
    transform: translateY(-3px); /* More pronounced lift */
    box-shadow: 0 8px 16px rgba(76, 175, 80, 0.4); /* Enhanced shadow on hover */
}

.ic-input,
.ic-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--ic-border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #f9fafb;
}

.ic-input:focus,
.ic-textarea:focus {
    outline: none;
    border-color: var(--ic-primary);
    box-shadow: 0 0 0 4px rgba(90, 125, 190, 0.2); /* Softer focus shadow */
    background-color: var(--ic-white);
}

.ic-textarea {
    min-height: 120px;
    resize: vertical;
}

/* --- LISTS (CATEGORIES & TOPICS) --- */
.ic-categories-list,
.ic-topics-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.ic-category-card,
.ic-topic-card {
    background: var(--ic-white);
    padding: 1.5rem 2rem;
    border-radius: var(--ic-radius);
    box-shadow: 0 4px 8px -2px var(--ic-shadow-color); /* Slightly softer initial shadow */
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smoother transition */
    border: 1px solid var(--ic-border-color);
}

.ic-category-card:hover,
.ic-topic-card:hover {
    transform: translateY(-5px); /* More pronounced lift */
    box-shadow: 0 12px 20px -8px var(--ic-shadow-color); /* Enhanced shadow on hover */
}

.ic-category-info h3,
.ic-topic-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.ic-category-info h3 a,
.ic-topic-info h3 a {
    color: var(--ic-primary);
    text-decoration: none;
    font-weight: 600;
}

.ic-category-info h3 a:hover,
.ic-topic-info h3 a:hover {
    text-decoration: underline;
}

.ic-category-meta,
.ic-topic-meta {
    color: var(--ic-text-light);
    font-size: 0.875rem;
    margin: 0;
}

.ic-category-last,
.ic-topic-stats {
    text-align: right;
    flex-shrink: 0;
    padding-left: 1.5rem;
    font-size: 0.9rem;
}

.ic-last-topic {
    margin: 0 0 0.25rem 0;
    color: var(--ic-text);
    font-weight: 500;
}

.ic-last-date {
    color: var(--ic-text-light);
    margin: 0;
}

.ic-topic-stats p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ic-white); /* Text color for stats */
    margin: 0;
    background-color: var(--ic-secondary); /* Use secondary color for background */
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

/* --- BREADCRUMB --- */
.ic-breadcrumb {
    background: var(--ic-white);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px var(--ic-shadow-color);
    font-size: 0.9rem;
    color: var(--ic-text-light);
}

.ic-breadcrumb a {
    color: var(--ic-primary);
    text-decoration: none;
    font-weight: 500;
}

.ic-breadcrumb a:hover {
    text-decoration: underline;
}

/* --- TOPIC HEADER --- */
.ic-topic-header {
    background: var(--ic-white);
    padding: 2rem;
    border-radius: var(--ic-radius);
    margin-bottom: 2rem;
    box-shadow: 0 4px 8px -2px var(--ic-shadow-color); /* Consistent shadow */
    border-left: 4px solid var(--ic-primary);
}

.ic-topic-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--ic-primary);
}

/* --- POSTS (TOPIC & REPLIES) --- */
.ic-post {
    display: flex;
    background: var(--ic-white);
    border: 1px solid var(--ic-border-color);
    border-radius: var(--ic-radius);
    margin-bottom: 2rem;
    box-shadow: 0 4px 8px -2px var(--ic-shadow-color); /* Consistent shadow */
    overflow: hidden;
    transition: all 0.3s ease; /* Added transition for posts */
}

.ic-main-post {
    background-color: var(--ic-white);
    border: 1px solid var(--ic-primary); /* Border color matches primary */
}

.ic-reply-post {
    border-top: 3px solid var(--ic-secondary); /* Border color matches secondary */
}

.ic-post-author {
    flex: 0 0 160px;
    padding: 1.5rem;
    background: var(--ic-background); /* Use background variable */
    border-right: 1px solid var(--ic-border-color);
    text-align: center;
}

.ic-author-name {
    font-weight: 600;
    color: var(--ic-primary);
    margin: 0 0 0.5rem 0;
    font-size: 1.05rem;
}

.ic-post-date {
    font-size: 0.8rem;
    color: var(--ic-text-light);
    margin: 0;
}

.ic-post-content {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.ic-post-content h2 {
    margin: 0 0 1.5rem 0;
    font-size: 1.75rem;
    color: var(--ic-text);
}

.ic-post-text {
    flex-grow: 1;
    line-height: 1.7;
    color: var(--ic-text);
    font-size: 1rem;
}

.ic-post-text p {
    margin-top: 0;
    margin-bottom: 1.25em;
}
.ic-post-text p:last-child {
    margin-bottom: 0;
}

.ic-post-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--ic-border-color);
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.ic-post-actions a {
    color: var(--ic-text-light);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s;
}

.ic-post-actions a:hover {
    color: var(--ic-secondary); /* Hover color matches secondary */
    text-decoration: underline;
}

.ic-post-actions .dashicons {
    font-size: 16px;
}

/* --- REPLY FORM --- */
.ic-reply-form {
    background: var(--ic-white);
    padding: 2rem;
    border-radius: var(--ic-radius);
    margin-top: 2rem;
    box-shadow: 0 4px 8px -2px var(--ic-shadow-color); /* Consistent shadow */
    border: 1px solid var(--ic-border-color);
}

.ic-reply-form h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.ic-guest-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ic-guest-notify {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- MISC --- */
.ic-empty-message {
    background: var(--ic-white);
    padding: 3rem;
    border-radius: var(--ic-radius);
    text-align: center;
    font-size: 1.1rem;
    color: var(--ic-text-light);
    border: 1px dashed var(--ic-border-color); /* Use border color variable */
}

.ic-hidden-by-default {
    display: none;
}

.ic-edit-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ic-edit-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .ic-post {
        flex-direction: column;
    }

    .ic-post-author {
        flex-basis: auto;
        border-right: none;
        border-bottom: 1px solid var(--ic-border-color);
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 1.5rem;
    }
    
    .ic-author-name, .ic-post-date {
        margin: 0;
    }

    .ic-category-card, .ic-topic-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .ic-category-last, .ic-topic-stats {
        text-align: left;
        padding-left: 0;
        margin-top: 0.5rem;
    }

    .ic-guest-fields {
        grid-template-columns: 1fr;
    }
}
