/* PriceTrackIt Comments Widget Styles */

/* Global box-sizing for consistent sizing */
* {
    box-sizing: border-box;
}

.pricetrackit-comments-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.pricetrackit-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.pricetrackit-header h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 600;
}

.pricetrackit-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.tab-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tab-button.active {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    font-weight: 600;
}

.pricetrackit-auth-section {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.login-prompt {
    text-align: center;
}

.login-prompt p {
    margin: 0 0 15px 0;
    color: #6b7280;
    font-size: 16px;
}

.google-login-btn {
    background: #1252A1;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.google-login-btn:hover {
    background: #3367d6;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.user-name {
    font-weight: 600;
    color: #374151;
}

.logout-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background: #dc2626;
}

.pricetrackit-comment-form {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    box-sizing: border-box;
}

.pricetrackit-comment-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.pricetrackit-comment-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

.pricetrackit-comment-form button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.pricetrackit-comment-form button:hover {
    background: #5a67d8;
}

.pricetrackit-comments-list {
    padding: 20px;
}

.loading {
    text-align: center;
    color: #6b7280;
    padding: 40px;
    font-size: 16px;
}

.error {
    text-align: center;
    color: #ef4444;
    padding: 40px;
    font-size: 16px;
}

.no-comments {
    text-align: center;
    color: #6b7280;
    padding: 40px;
    font-size: 16px;
}

/* Comment Styles */
.comment-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.comment-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

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

.comment-author-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
    background: #f3f4f6;
}

.user-avatar-fallback {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    border: 2px solid #e5e7eb;
}

.comment-author {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.comment-date {
    color: #6b7280;
    font-size: 12px;
    white-space: nowrap;
}

.comment-content {
    color: #374151;
    line-height: 1.6;
    font-size: 14px;
    margin-bottom: 12px;
    white-space: pre-line;
}

.comment-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.reply-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(102, 126, 234, 0.2);
}

.reply-btn:hover {
    background: #5a67d8;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.reply-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(102, 126, 234, 0.2);
}

.reply-btn::before {
    content: "💬";
    font-size: 10px;
}

.delete-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.2);
}

.delete-btn:hover {
    background: #dc2626;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

.delete-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.2);
}

.delete-btn::before {
    content: "🗑️";
    font-size: 10px;
}

.reply-form {
    margin-top: 12px;
    padding: 16px;
    background: #f3f4f6;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.reply-form textarea {
    width: 100%;
    min-height: 60px;
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.reply-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

.reply-form .form-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.reply-form button {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reply-form .submit-reply {
    background: #667eea;
    color: white;
    border: none;
}

.reply-form .submit-reply:hover {
    background: #5a67d8;
}

.reply-form .cancel-reply {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.reply-form .cancel-reply:hover {
    background: #f3f4f6;
}

/* Nested Replies - Unlimited Levels */
.comment-replies {
    margin-left: 24px;
    margin-top: 12px;
    padding-left: 16px;
    border-left: 2px solid #e5e7eb;
}

.reply-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    margin-left: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

.reply-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.reply-author-section {
    display: flex;
    align-items: center;
    gap: 6px;
}

.reply-author {
    font-weight: 600;
    color: #374151;
    font-size: 13px;
}

.reply-date {
    color: #6b7280;
    font-size: 11px;
}

.reply-content {
    color: #374151;
    line-height: 1.5;
    font-size: 13px;
    white-space: pre-line;
}

/* Multiple nesting levels */
.comment-item[data-level="1"] .comment-replies {
    margin-left: 20px;
    border-left-color: #d1d5db;
}

.comment-item[data-level="2"] .comment-replies {
    margin-left: 18px;
    border-left-color: #9ca3af;
}

.comment-item[data-level="3"] .comment-replies {
    margin-left: 16px;
    border-left-color: #6b7280;
}

.comment-item[data-level="4"] .comment-replies {
    margin-left: 14px;
    border-left-color: #4b5563;
}

.comment-item[data-level="5"] .comment-replies {
    margin-left: 12px;
    border-left-color: #374151;
}

/* Deep nesting (level 6+) */
.comment-item[data-level="6"] .comment-replies,
.comment-item[data-level="7"] .comment-replies,
.comment-item[data-level="8"] .comment-replies,
.comment-item[data-level="9"] .comment-replies {
    margin-left: 10px;
    border-left-color: #1f2937;
}

/* Responsive adjustments for deep nesting */
@media (max-width: 768px) {
    .comment-replies {
        margin-left: 16px;
        padding-left: 12px;
    }
    
    .comment-item[data-level="1"] .comment-replies {
        margin-left: 14px;
    }
    
    .comment-item[data-level="2"] .comment-replies {
        margin-left: 12px;
    }
    
    .comment-item[data-level="3"] .comment-replies {
        margin-left: 10px;
    }
    
    .comment-item[data-level="4"] .comment-replies,
    .comment-item[data-level="5"] .comment-replies,
    .comment-item[data-level="6"] .comment-replies,
    .comment-item[data-level="7"] .comment-replies,
    .comment-item[data-level="8"] .comment-replies,
    .comment-item[data-level="9"] .comment-replies {
        margin-left: 8px;
    }
    
    /* Smaller avatars on mobile */
    .user-avatar,
    .user-avatar-fallback {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .comment-author-section,
    .reply-author-section {
        gap: 6px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .pricetrackit-comments-widget {
        margin: 10px;
        border-radius: 8px;
    }
    
    .pricetrackit-header {
        padding: 15px;
    }
    
    .pricetrackit-header h3 {
        font-size: 20px;
    }
    
    .pricetrackit-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .tab-button {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .comment-replies {
        margin-left: 16px;
        padding-left: 12px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
    }
    
    /* Mobile textarea adjustments */
    .pricetrackit-comment-form {
        padding: 15px;
    }
    
    .pricetrackit-comment-form textarea {
        min-height: 80px;
        font-size: 14px;
    }
    
    .reply-form {
        padding: 12px;
    }
    
    .reply-form textarea {
        min-height: 50px;
        font-size: 13px;
    }
} 