/* =========================================
   ZENCOMMENTS PUBLIC STYLES
   Theme: Bordeaux Red (#800020) & Sky Blue Accents
   Style: Flat (No Shadows), Modern Clean
   ========================================= */

/* 1. LAYOUT & CONTAINER */

/* Giới hạn chiều rộng và căn giữa khu vực bình luận */
#comments {
    max-width: 768px;
    margin-left: auto;
    margin-right: auto;
}

/* Ẩn các trường mặc định của WordPress */
.comment-form-author,
.comment-form-email,
.comment-form-url,
.comment-form-cookies-consent {
    display: none !important;
    visibility: hidden !important;
}

/* Container chính */
.zc-container {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    /* gray-200 */
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    /* Removed box-shadow for flat design */
}

/* 2. COMMENT TYPE SWITCHER (Segmented Control) */
.zc-comment-type-switcher {
    display: flex;
    background-color: #f3f4f6;
    /* gray-100 */
    border-radius: 8px;
    /* Slightly less rounded for flat feel */
    padding: 4px;
    margin-bottom: 24px;
    position: relative;
    /* Removed inset shadow */
}

.zc-type-label {
    flex: 1;
    position: relative;
    cursor: pointer;
    border-radius: 6px;
    text-align: center;
    z-index: 1;
    transition: all 0.2s ease;
}

.zc-type-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.zc-type-content {
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.zc-type-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #4b5563;
    /* gray-600 */
    transition: color 0.2s ease;
}

.zc-type-note {
    font-size: 0.75rem;
    color: #9ca3af;
    /* gray-400 */
    margin-top: 2px;
    font-weight: 400;
    transition: color 0.2s ease;
}

/* Trạng thái Active */
.zc-type-label.is-selected {
    background-color: #800020;
    /* Bordeaux Red */
    /* Removed shadow */
}

.zc-type-label.is-selected .zc-type-title,
.zc-type-label.is-selected .zc-type-note {
    color: #ffffff;
}

/* 3. INPUT FIELDS */
.zc-field-group {
    margin-bottom: 20px;
}

.zc-field-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
    /* gray-700 */
    font-size: 0.95rem;
}

#zc_nickname,
#zc_verify_passcode_input,
#zc-passcode-input,
.zc-verify-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    /* gray-200 */
    border-radius: 8px;
    background-color: #f9fafb;
    /* gray-50 */
    color: #1f2937;
    font-size: 1rem;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    box-sizing: border-box;
    /* Removed shadow/glow */
}

#zc_nickname:focus,
#zc_verify_passcode_input:focus,
#zc-passcode-input:focus,
.zc-verify-group input:focus {
    outline: none;
    border-color: #800020;
    /* Bordeaux Red */
    background-color: #ffffff;
}

#zc_nickname::-webkit-input-placeholder {
    color: #9ca3af;
}

#zc_nickname:-moz-placeholder {
    color: #9ca3af;
}

/* 4. AVATAR GRID */
.zc-avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 16px;
    padding: 8px 0;
}

.zc-avatar-item {
    cursor: pointer;
    position: relative;
    border-radius: 50%;
    transition: transform 0.2s ease;
    padding: 2px;
    border: 2px solid transparent;
}

.zc-avatar-item:hover {
    transform: scale(1.05);
    /* Subtle scale only */
    z-index: 10;
}

.zc-avatar-item img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 50%;
    /* Removed shadow */
}

/* Selected Avatar State */
.zc-avatar-item.selected {
    border-color: #800020;
}

.zc-avatar-item.selected::after {
    content: '✓';
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: #800020;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid #ffffff;
    /* Removed shadow & animation */
}

/* 5. BUTTONS */
#respond .form-submit input#submit,
#zc-submit-verify-passcode,
#zc-submit-passcode,
.zc-verify-group button {
    background-color: #800020;
    /* Bordeaux Red */
    color: #ffffff;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    /* Less rounded for flat look */
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Removed shadow */
}

#respond .form-submit input#submit:hover,
#zc-submit-verify-passcode:hover,
#zc-submit-passcode:hover,
.zc-verify-group button:hover {
    background-color: #9b1c31;
    /* Removed transform translateY */
}

/* 6. UTILITY / DYNAMIC SECTIONS */

/* Nickname fields animation */
#zc-nickname-fields {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    /* Removed transform Y */
    transition: max-height 0.4s ease, opacity 0.3s ease, margin-top 0.3s ease;
    margin-top: 0;
}

#zc-nickname-fields.is-active {
    max-height: 600px;
    opacity: 1;
    margin-top: 24px;
}

/* Notices */
#zc-nickname-notice {
    font-size: 0.9rem;
    padding-top: 8px;
    display: block;
    font-weight: 500;
}

/* SUCCESS -> SKY BLUE */
#zc-nickname-notice.success {
    color: #0284c7;
    /* sky-600 */
}

#zc-nickname-notice.error {
    color: #b91c1c;
    /* red-700 */
}

#zc-nickname-notice .zc-show-verify-form-link {
    color: #800020;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 700;
}

/* Welcome Back Card -> Refined Style */
.zc-welcome-card {
    background-color: #f0f9ff;
    /* Sky Blue Lightest for background */
    border: 1px solid #bae6fd;
    /* Sky Blue Border */
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.zc-welcome-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.zc-welcome-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.zc-welcome-text {
    font-size: 1rem;
    color: #0369a1;
    /* Sky Blue Dark */
    line-height: 1.4;
}

.zc-welcome-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #ffffff;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    padding: 12px;
}

#zc-set-passcode-prompt {
    font-size: 0.9rem;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

#zc-show-passcode-form {
    color: #0284c7;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

#zc-show-passcode-form:hover {
    text-decoration: underline;
}

/* Inline Verify & Passcode Forms */
#zc-inline-verify-section {
    border: 1px dashed #800020;
    background-color: #fff1f2;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

#zc-passcode-form-container {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.zc-form-note {
    font-size: 0.85rem;
    color: #6b7280;
    width: 100%;
    margin-top: 8px;
}

/* SUCCESS -> SKY BLUE */
.zc-passcode-success {
    color: #0284c7;
    /* sky-600 */
    font-weight: 600;
    padding: 10px;
    background-color: #e0f2fe;
    /* sky-100 */
    border-radius: 8px;
    display: inline-block;
}

/* 7. RESPONSIVE */
@media (max-width: 600px) {
    .zc-container {
        padding: 16px;
    }

    .zc-type-content {
        padding: 8px;
    }

    .zc-type-title {
        font-size: 0.85rem;
    }

    .zc-type-note {
        font-size: 0.7rem;
    }

    .zc-verify-group {
        flex-direction: column;
        align-items: stretch;
    }

    .zc-verify-group input {
        margin-bottom: 10px;
    }

    .zc-verify-group button {
        width: 100%;
    }
}

/* 8. COMMENT ACTIONS (HEART) */
.zc-comment-actions {
    margin-top: 12px;
    display: flex;
    align-items: center;
}

.zc-heart-btn {
    background: transparent !important;
    background-color: #f3f4f6 !important;
    border: none !important;
    box-shadow: none !important;
    padding: 6px 10px !important;
    border-radius: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    color: #6b7280 !important; /* gray-500 */
    transition: all 0.2s ease !important;
    line-height: 1 !important;
    min-height: 0 !important;
    height: auto !important;
}

.zc-heart-btn:hover {
    background-color: #ffe4e6 !important; /* rose-100 */
    color: #e11d48 !important; /* rose-600 */
}

.zc-heart-btn.is-liked {
    color: #e11d48 !important;
    background-color: #ffe4e6 !important;
}

.zc-heart-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-image 0.2s ease;
}

.zc-heart-btn:hover .zc-heart-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e11d48' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'/%3E%3C/svg%3E");
}

.zc-heart-btn:active .zc-heart-icon {
    transform: scale(0.8);
}

.zc-heart-btn.is-liked .zc-heart-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e11d48' stroke='%23e11d48' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'/%3E%3C/svg%3E");
    animation: zcHeartPop 0.3s ease-out forwards;
}

.zc-like-count {
    font-size: 0.9rem;
    font-weight: 600;
}

@keyframes zcHeartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}