/* Inline Comments System Styles */
/* css/inline-comments.css */

/* Animation Keyframes */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Main Comment Section */
.inline-comments-section {
    margin-top: 1rem;
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    animation: fadeInUp 0.3s ease;
}

.comments-dropdown {
    width: 100%;
}

/* Comments Header */
.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comments-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.comments-icon {
    font-size: 1.1rem;
}

.comments-count {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.close-comments {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-comments:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Comment Composer */
.comment-composer {
    padding: 1.25rem;
    background: #fafbfc;
    border-bottom: 1px solid #e0e6ed;
}

.composer-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.user-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #667eea;
}

.composer-input {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.composer-input textarea {
    width: 100%;
    min-height: 45px;
    max-height: 100px;
    padding: 0.75rem;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.4;
    resize: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: white;
}

.composer-input textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.composer-tools {
    display: flex;
    gap: 0.25rem;
}

.tool-btn {
    background: none;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    padding: 0.4rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.tool-btn:hover {
    background: #f1f3f4;
    border-color: #667eea;
    transform: scale(1.1);
}

.composer-submit {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.char-count {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

.char-count.over-limit {
    color: #e74c3c;
    font-weight: 600;
}

.composer-submit .btn {
    min-width: 60px;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

/* Comments List */
.comments-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
}

.loading-comments,
.no-comments,
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
    color: #6c757d;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e0e6ed;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-comments-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.error-message {
    color: #e74c3c;
}

.retry-btn {
    margin-top: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
}

.retry-btn:hover {
    background: #5a6fd8;
}

/* Individual Comments */
.comment-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f2f5;
    transition: background-color 0.2s ease;
}

.comment-item:hover {
    background: #fafbfc;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e0e6ed;
}

.comment-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.comment-author {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.comment-time {
    color: #6c757d;
    font-size: 0.8rem;
}

.comment-text {
    color: #2c3e50;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.comment-text .mention {
    color: #667eea;
    font-weight: 600;
}

.comment-text .hashtag {
    color: #27ae60;
    font-weight: 600;
}

.comment-text a {
    color: #667eea;
    text-decoration: none;
}

.comment-text a:hover {
    text-decoration: underline;
}

.comment-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.action-btn {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #f1f3f4;
    color: #495057;
}

.action-icon {
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}

.action-icon.liked {
    color: #667eea;
    transform: scale(1.1);
}

.action-count {
    font-weight: 500;
    font-size: 0.8rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .inline-comments-section {
        margin-top: 0.75rem;
        border-radius: 8px;
    }
    
    .comments-header {
        padding: 0.75rem 1rem;
    }
    
    .comment-composer {
        padding: 1rem;
    }
    
    .composer-wrapper {
        gap: 0.5rem;
    }
    
    .user-avatar img {
        width: 32px;
        height: 32px;
    }
    
    .composer-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .composer-tools {
        justify-content: center;
    }
    
    .composer-submit {
        justify-content: space-between;
    }
    
    .comment-item {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }
    
    .comment-avatar img {
        width: 28px;
        height: 28px;
    }
    
    .comment-actions {
        gap: 0.75rem;
    }
    
    .comments-list {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .comments-header {
        padding: 0.5rem 0.75rem;
    }
    
    .comments-title {
        font-size: 0.85rem;
    }
    
    .comment-composer {
        padding: 0.75rem;
    }
    
    .composer-input textarea {
        font-size: 0.85rem;
        padding: 0.6rem;
    }
    
    .tool-btn {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .comment-item {
        padding: 0.6rem 0.75rem;
    }
    
    .comment-author {
        font-size: 0.85rem;
    }
    
    .comment-text {
        font-size: 0.85rem;
    }
    
    .comment-time {
        font-size: 0.75rem;
    }
    
    .action-btn {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .inline-comments-section {
        background: #2c3e50;
        border-color: #34495e;
    }
    
    .comment-composer {
        background: #34495e;
        border-color: #4a5f7a;
    }
    
    .composer-input textarea {
        background: #2c3e50;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }
    
    .composer-input textarea:focus {
        border-color: #667eea;
    }
    
    .tool-btn {
        border-color: #4a5f7a;
        color: #ecf0f1;
    }
    
    .tool-btn:hover {
        background: #4a5f7a;
    }
    
    .char-count {
        color: #95a5a6;
    }
    
    .comment-item {
        border-color: #4a5f7a;
    }
    
    .comment-item:hover {
        background: #34495e;
    }
    
    .comment-author {
        color: #ecf0f1;
    }
    
    .comment-text {
        color: #bdc3c7;
    }
    
    .comment-time {
        color: #95a5a6;
    }
    
    .action-btn {
        color: #95a5a6;
    }
    
    .action-btn:hover {
        background: #4a5f7a;
        color: #ecf0f1;
    }
    
    .loading-comments,
    .no-comments {
        color: #95a5a6;
    }
}

/* Accessibility Improvements */
.inline-comments-section:focus-within {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.close-comments:focus,
.tool-btn:focus,
.action-btn:focus,
.retry-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.composer-input textarea:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .inline-comments-section {
        border-width: 2px;
    }
    
    .comments-header {
        border-bottom-width: 2px;
    }
    
    .comment-composer {
        border-bottom-width: 2px;
    }
    
    .composer-input textarea {
        border-width: 2px;
    }
    
    .tool-btn {
        border-width: 2px;
    }
    
    .comment-item {
        border-bottom-width: 2px;
    }
}
