/**
 * JUBU Ratings - Comments Section Styles
 * 
 * Art Deco themed comments display
 * 
 * @package JUBU_Ratings
 * @since 1.1.0
 */

/* ============================================
   Variables
   ============================================ */
:root {
    --jubu-gold: #d4af37;
    --jubu-gold-light: #f4d03f;
    --jubu-gold-dark: #b8941e;
    --jubu-black: #0a0a0a;
    --jubu-dark-gray: #1a1a1a;
}

/* ============================================
   Comments Section Container
   ============================================ */
.jubu-comments-section {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.6), rgba(10, 10, 10, 0.8));
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    position: relative;
}

/* Art Deco corners */
.jubu-comments-section::before,
.jubu-comments-section::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(212, 175, 55, 0.4);
}

.jubu-comments-section::before {
    top: 8px;
    left: 8px;
    border-right: none;
    border-bottom: none;
}

.jubu-comments-section::after {
    bottom: 8px;
    right: 8px;
    border-left: none;
    border-top: none;
}

/* ============================================
   Comments Header
   ============================================ */
.jubu-comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(212, 175, 55, 0.2);
}

.jubu-comments-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--jubu-gold);
    letter-spacing: 0.05em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.jubu-comments-title-icon {
    font-size: 1.2rem;
}

.jubu-comments-count {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(212, 175, 55, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

/* ============================================
   Comment Form
   ============================================ */
.jubu-comment-form {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(10, 10, 10, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 4px;
}

.jubu-comment-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.jubu-comment-form-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    color: var(--jubu-gold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.jubu-comment-char-count {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.3s ease;
}

.jubu-comment-char-count.warning {
    color: #ff9800;
}

.jubu-comment-char-count.error {
    color: #f44336;
}

.jubu-comment-textarea {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    background: rgba(26, 26, 26, 0.8);
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.3s ease;
}

.jubu-comment-textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.jubu-comment-textarea:focus {
    outline: none;
    border-color: var(--jubu-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.jubu-comment-textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.jubu-comment-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
}

.jubu-comment-submit {
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--jubu-gold-dark), var(--jubu-gold));
    border: none;
    border-radius: 4px;
    color: var(--jubu-black);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    clip-path: polygon(
        8px 0, 
        100% 0, 
        100% calc(100% - 8px), 
        calc(100% - 8px) 100%, 
        0 100%, 
        0 8px
    );
}

.jubu-comment-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--jubu-gold), var(--jubu-gold-light));
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.jubu-comment-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.jubu-comment-submit.loading {
    position: relative;
    color: transparent;
}

.jubu-comment-submit.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border: 2px solid rgba(10, 10, 10, 0.3);
    border-top-color: var(--jubu-black);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.jubu-comment-hint {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Rate to comment notice */
.jubu-comment-rate-notice {
    padding: 15px 20px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    color: var(--jubu-gold);
}

.jubu-comment-rate-notice-icon {
    margin-right: 8px;
}

/* ============================================
   Comments List
   ============================================ */
.jubu-comments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.jubu-comments-empty {
    text-align: center;
    padding: 40px 20px;
    font-family: 'Montserrat', sans-serif;
    color: rgba(255, 255, 255, 0.5);
}

.jubu-comments-empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.jubu-comments-empty-text {
    font-size: 1rem;
    margin-bottom: 5px;
}

.jubu-comments-empty-subtext {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* ============================================
   Single Comment Item
   ============================================ */
.jubu-comment-item {
    padding: 15px 20px;
    background: rgba(26, 26, 26, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 4px;
    transition: all 0.3s ease;
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.jubu-comment-item:hover {
    border-color: rgba(212, 175, 55, 0.3);
    background: rgba(26, 26, 26, 0.6);
}

.jubu-comment-item.own-comment {
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.3);
}

.jubu-comment-item.own-comment::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--jubu-gold);
    border-radius: 2px 0 0 2px;
}

.jubu-comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.jubu-comment-passenger {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    color: var(--jubu-gold);
    font-weight: 600;
}

.jubu-comment-passenger-icon {
    font-size: 1rem;
}

.jubu-comment-passenger-number {
    background: rgba(212, 175, 55, 0.2);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.jubu-comment-own-badge {
    font-size: 0.75rem;
    color: var(--jubu-gold);
    background: rgba(212, 175, 55, 0.15);
    padding: 3px 10px;
    border-radius: 10px;
    margin-left: 10px;
}

.jubu-comment-time {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

.jubu-comment-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    word-wrap: break-word;
}

/* ============================================
   Load More Button
   ============================================ */
.jubu-comments-load-more {
    text-align: center;
    margin-top: 20px;
}

.jubu-load-more-btn {
    padding: 12px 30px;
    background: transparent;
    border: 2px solid rgba(212, 175, 55, 0.4);
    border-radius: 4px;
    color: var(--jubu-gold);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.jubu-load-more-btn:hover:not(:disabled) {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--jubu-gold);
    transform: translateY(-2px);
}

.jubu-load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.jubu-load-more-btn.loading {
    position: relative;
    color: transparent;
}

.jubu-load-more-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-top-color: var(--jubu-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ============================================
   Messages (Success/Error)
   ============================================ */
.jubu-comment-message {
    padding: 12px 20px;
    margin-bottom: 15px;
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    text-align: center;
    animation: fadeIn 0.3s ease-out;
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.jubu-comment-message.success {
    display: block;
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.4);
    color: #4caf50;
}

.jubu-comment-message.error {
    display: block;
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid rgba(244, 67, 54, 0.4);
    color: #f44336;
}

.jubu-comment-message.pending {
    display: block;
    background: rgba(255, 152, 0, 0.15);
    border: 1px solid rgba(255, 152, 0, 0.4);
    color: #ff9800;
}

/* ============================================
   No Consent State
   ============================================ */
.jubu-comments-no-consent {
    text-align: center;
    padding: 30px 20px;
    background: rgba(10, 10, 10, 0.5);
    border: 1px dashed rgba(212, 175, 55, 0.3);
    border-radius: 4px;
}

.jubu-comments-no-consent-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.6;
}

.jubu-comments-no-consent-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .jubu-comments-section {
        padding: 20px 15px;
    }
    
    .jubu-comments-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .jubu-comment-form {
        padding: 15px;
    }
    
    .jubu-comment-form-footer {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .jubu-comment-submit {
        width: 100%;
    }
    
    .jubu-comment-hint {
        text-align: center;
    }
    
    .jubu-comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .jubu-comment-time {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .jubu-comments-title {
        font-size: 1.2rem;
    }
    
    .jubu-comment-textarea {
        min-height: 80px;
        font-size: 0.9rem;
    }
    
    .jubu-comment-text {
        font-size: 0.9rem;
    }
}

/* ============================================
   Dark Scrollbar (for comment list)
   ============================================ */
.jubu-comments-list::-webkit-scrollbar {
    width: 6px;
}

.jubu-comments-list::-webkit-scrollbar-track {
    background: rgba(26, 26, 26, 0.5);
    border-radius: 3px;
}

.jubu-comments-list::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 3px;
}

.jubu-comments-list::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}
