/* ==========================================================================
   Independent Comment Sections – Frontend Styles
   All classes prefixed with .ics-
   Minimal, neutral styling – easy to override
   ========================================================================== */

/* --- Container --- */
.ics-comment-section {
    max-width: 100%;
    margin: 1.5em 0;
    font-size: 1rem;
    line-height: 1.6;
}

/* --- Title --- */
.ics-title {
    margin: 0 0 1em;
    font-size: 1.3em;
    font-weight: 600;
}

/* --- Messages --- */
.ics-message-container {
    min-height: 0;
}

.ics-message {
    padding: 0.8em 1em;
    margin-bottom: 1.5em;
    border-left: 4px solid;
    border-radius: 2px;
}

.ics-message-success {
    background-color: #f0f9f0;
    border-color: #46a046;
    color: #2a6e2a;
}

.ics-message-error {
    background-color: #fef0f0;
    border-color: #d63638;
    color: #8b1a1c;
}

.ics-message-error ul {
    margin: 0.5em 0 0 1.2em;
    padding: 0;
}

.ics-message-error li {
    margin-bottom: 0.25em;
}

/* --- No comments --- */
.ics-no-comments {
    color: #666;
    font-style: italic;
    margin-bottom: 1.5em;
}

/* --- Comments list --- */
.ics-comments-list {
    margin-bottom: 2em;
}

/* --- Single comment --- */
.ics-comment {
    padding: 1em 0;
    border-bottom: 1px solid #e0e0e0;
}

.ics-comment:last-child {
    border-bottom: none;
}

.ics-comment-header {
    display: flex;
    align-items: baseline;
    gap: 0.8em;
    margin-bottom: 0.4em;
    flex-wrap: wrap;
}

.ics-comment-author {
    font-weight: 600;
}

.ics-comment-date {
    font-size: 0.85em;
    color: #888;
}

.ics-comment-content {
    margin-bottom: 0.5em;
}

/* --- Load more button --- */
.ics-load-more-wrapper {
    display: flex;
    align-items: center;
    gap: 0.8em;
    margin: 1em 0 1.5em;
}

.ics-load-more-button {
    display: inline-block;
    padding: 0.5em 1.2em;
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.ics-load-more-button:hover {
    background-color: #e0e0e0;
    border-color: #bbb;
}

.ics-load-more-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- Truncated (read more) comments --- */
.ics-comment-content-full {
    display: none;
}

.ics-read-more-toggle {
    background: none;
    border: none;
    padding: 0;
    color: #0073aa;
    cursor: pointer;
    font-size: 0.85em;
    text-decoration: underline;
    margin-top: 0.3em;
    display: inline-block;
}

.ics-read-more-toggle:hover {
    color: #005177;
}

/* --- Reply button --- */
.ics-reply-button {
    background: none;
    border: none;
    padding: 0;
    color: #0073aa;
    cursor: pointer;
    font-size: 0.85em;
    text-decoration: underline;
}

.ics-reply-button:hover {
    color: #005177;
}

/* --- Replies (indented) --- */
.ics-replies {
    margin-left: 2em;
    border-left: 2px solid #e0e0e0;
    padding-left: 1em;
}

.ics-reply {
    padding: 0.8em 0;
}

/* --- Inline reply slot --- */
.ics-inline-reply-slot {
    min-height: 0;
}

/* --- Form wrapper --- */
.ics-form-wrapper {
    margin-top: 1.5em;
}

/* --- Form appears inline when replying --- */
.ics-form-inline {
    margin-top: 0.8em;
    margin-left: 2em;
    padding: 1em;
    border-left: 3px solid #0073aa;
    background-color: #f9fbfd;
    border-radius: 0 4px 4px 0;
}

/* --- Reply indicator bar --- */
.ics-reply-indicator {
    display: flex;
    align-items: center;
    gap: 0.8em;
    margin-bottom: 1em;
    padding: 0.5em 0.8em;
    background-color: #eef4fa;
    border-radius: 3px;
    font-size: 0.9em;
    color: #333;
}

.ics-replying-to-text {
    font-weight: 600;
}

.ics-cancel-reply {
    background: none;
    border: none;
    padding: 0;
    margin-left: auto;
    color: #d63638;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.9em;
}

.ics-cancel-reply:hover {
    color: #a02022;
}

/* --- Form --- */
.ics-comment-form {
    padding-top: 1em;
    border-top: 1px solid #e0e0e0;
}

.ics-form-inline .ics-comment-form {
    border-top: none;
    padding-top: 0;
}

.ics-form-field {
    margin-bottom: 1em;
}

/* --- Name + Email side by side on desktop --- */
.ics-form-row-double {
    display: flex;
    gap: 1em;
}

.ics-form-field-half {
    flex: 1;
    min-width: 0;
}

@media (max-width: 600px) {
    .ics-form-row-double {
        flex-direction: column;
        gap: 0;
    }
}

/* --- Labels --- */
.ics-label {
    display: block;
    margin-bottom: 0.3em;
    font-weight: 500;
}

.ics-required {
    color: #d63638;
}

/* --- Inputs --- */
.ics-input,
.ics-textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0.5em 0.7em;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-family: inherit;
    font-size: 1em;
    box-sizing: border-box;
}

.ics-input:focus,
.ics-textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

.ics-input-small {
    max-width: 120px;
}

/* --- Captcha --- */
.ics-captcha-field .ics-label {
    font-weight: 500;
}

/* --- Privacy checkbox --- */
.ics-label-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5em;
    font-weight: 400;
}

.ics-label-checkbox input[type="checkbox"] {
    margin-top: 0.3em;
}

/* --- Honeypot (hidden) --- */
.ics-hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

/* --- Submit button + spinner --- */
.ics-form-submit {
    display: flex;
    align-items: center;
    gap: 0.8em;
}

.ics-submit-button {
    display: inline-block;
    padding: 0.6em 1.5em;
    background-color: #333;
    color: #fff;
    border: 1px solid #333;
    border-radius: 3px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.ics-submit-button:hover {
    background-color: #555;
    border-color: #555;
}

.ics-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- Loading spinner --- */
.ics-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: ics-spin 0.6s linear infinite;
}

@keyframes ics-spin {
    to { transform: rotate(360deg); }
}

/* --- Admin notice (only for logged-in admins) --- */
.ics-admin-notice {
    padding: 0.5em 0.8em;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 3px;
    color: #856404;
    font-size: 0.9em;
}
