* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    padding: 30px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

header h1 {
    color: #2d3748;
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.subtitle {
    color: #718096;
    font-size: 1.1rem;
}

/* Sections */
section {
    margin-bottom: 40px;
}

h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

/* Form Styles */
.comment-form, .modal-body {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.avatar-selector {
    position: relative;
    cursor: pointer;
}

#selected-avatar, #reply-selected-avatar {
    display: inline-block;
    width: 50px;
    height: 50px;
    background: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    transition: transform 0.3s;
}

.avatar-selector:hover #selected-avatar,
.avatar-selector:hover #reply-selected-avatar {
    transform: scale(1.1);
}

.avatar-dropdown {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding: 10px;
    min-width: 200px;
}

.avatar-selector:hover .avatar-dropdown {
    display: block;
}

.avatar-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.avatar-option {
    font-size: 24px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.3s;
}

.avatar-option:hover {
    background: #f0f0f0;
}

input[type="text"] {
    flex: 1;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.textarea-wrapper {
    position: relative;
    margin-bottom: 20px;
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.emoji-picker-container {
    position: relative;
    margin-top: 10px;
}

.emoji-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.3s;
}

.emoji-btn:hover {
    background: #5a67d8;
}

.emoji-picker {
    display: none;
    position: absolute;
    bottom: 50px;
    left: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    min-width: 250px;
}

.emoji-picker.active {
    display: block;
}

.emoji-category {
    margin-bottom: 10px;
}

.emoji-category h4 {
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 14px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
}

.emoji-item {
    font-size: 20px;
    padding: 5px;
    cursor: pointer;
    text-align: center;
    border-radius: 5px;
    transition: background 0.2s;
}

.emoji-item:hover {
    background: #f0f0f0;
}

.btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.3s, box-shadow 0.3s;
    width: 100%;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Comments Container */
.comments-container {
    margin-top: 20px;
}

.comment {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.comment-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.comment-avatar {
    width: 45px;
    height: 45px;
    background: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.comment-info h4 {
    color: #2d3748;
    margin-bottom: 5px;
}

.comment-time {
    color: #718096;
    font-size: 14px;
}

.comment-content {
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 16px;
    padding-left: 60px;
}

.comment-actions {
    display: flex;
    gap: 20px;
    padding-left: 60px;
}

.action-btn {
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
    padding: 8px 15px;
    border-radius: 20px;
}

.action-btn:hover {
    color: #667eea;
    background: #f7fafc;
}

.action-btn.liked {
    color: #e53e3e;
}

.reply-btn:hover {
    color: #38a169;
}

.delete-btn:hover {
    color: #e53e3e;
}

/* Replies Section */
.replies-container {
    margin-top: 20px;
    margin-left: 60px;
    padding-left: 20px;
    border-left: 3px solid #e2e8f0;
}

.reply {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
}

.reply-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.reply-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reply-avatar {
    width: 35px;
    height: 35px;
    background: #38a169;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.reply-info h5 {
    color: #2d3748;
    margin-bottom: 3px;
    font-size: 14px;
}

.reply-time {
    color: #718096;
    font-size: 12px;
}

.reply-content {
    color: #4a5568;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    padding-left: 45px;
}

.reply-actions {
    display: flex;
    gap: 15px;
    padding-left: 45px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    color: #2d3748;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #718096;
}

.modal-body {
    padding: 20px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #718096;
    font-size: 18px;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    color: #718096;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        border-radius: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .comment {
        padding: 20px;
    }
    
    .comment-content {
        padding-left: 0;
    }
    
    .comment-actions {
        padding-left: 0;
        flex-wrap: wrap;
    }
    
    .replies-container {
        margin-left: 20px;
        padding-left: 15px;
    }
    
    .avatar-options {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
    }
    
    .user-info {
        flex-direction: column;
        align-items: stretch;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .reply-content {
        padding-left: 0;
    }
    
    .reply-actions {
        padding-left: 0;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}