/* ========================================
   SIMPLE & CLEAN COMPLAINTS SYSTEM
   ======================================== */

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 0;
    line-height: 1.4;
}

/* Main Container */
.main-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Search Section */
.search-section {
    background: white;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 15px;
    outline: none;
}

.search-input:focus {
    border-color: #1877f2;
}

.filter-row {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: white;
    color: #666;
    font-size: 14px;
    cursor: pointer;
}

.filter-btn.active {
    background: #1877f2;
    color: white;
    border-color: #1877f2;
}

/* Post Card */
.post-card {
    background: white;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Post Header */
.post-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    position: relative;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1877f2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 12px;
}

.post-info {
    flex: 1;
}

.post-author {
    font-weight: 600;
    color: #1c1e21;
    font-size: 15px;
    margin: 0;
}

.post-time {
    color: #65676b;
    font-size: 13px;
    margin: 0;
}

/* Badges */
.post-type-badge {
    position: absolute;
    right: 16px;
    top: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    z-index: 10;
}

.post-type-complaint { background: #ffebee; color: #c62828; }
.post-type-suggestion { background: #e8f5e8; color: #2e7d32; }
.post-type-inquiry { background: #e3f2fd; color: #1565c0; }
.post-type-thanks { background: #fff3e0; color: #ef6c00; }

.status-badge {
    position: absolute;
    top: 12px;
    left: 16px;
    right: auto;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    z-index: 10;
}

.status-new { background: #4caf50; }
.status-review { background: #ff9800; }
.status-closed { background: #f44336; }
.status-open { background: #2196f3; }

/* Post Content */
.post-content {
    padding: 0 16px 12px;
}

.post-text {
    color: #1c1e21;
    font-size: 15px;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.post-media img {
    width: 100%;
    border-radius: 8px;
    max-height: 400px;
    object-fit: cover;
}

/* Post Actions */
.post-actions {
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
}

.reactions-container {
    position: relative;
}

.post-action-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    color: #65676b;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-action-btn:hover {
    background: #f0f2f5;
}

.post-action-btn.active {
    color: #1877f2;
}

.post-owner-actions {
    display: flex;
    gap: 8px;
}

.post-action-btn.edit-btn {
    background: #4caf50;
    color: white;
}

.post-action-btn.delete-btn {
    background: #f44336;
    color: white;
}

.post-action-btn.report-btn {
    background: #ff6b6b;
    color: white;
}

/* Reactions Menu */
.reactions-menu {
    position: absolute;
    bottom: 100%;
     
    background: white;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 4px 6px;
    display: none;
    z-index: 1000;
    margin-bottom: 8px;
}

.reactions-menu.show {
    display: flex;
}

.reaction-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    margin: 0 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: white;
}

.reaction-btn:hover {
    transform: scale(1.2);
}

/* Interaction Summary */
.post-interaction-summary {
    padding: 4px 16px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.interaction-summary-btn {
    color: #65676b;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.interaction-summary-btn:hover {
    text-decoration: underline;
}

/* Interaction Bar */
.post-interaction-bar {
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    background: white;
    border-top: 1px solid #eee;
}

.interaction-bar-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #65676b;
    flex: 1;
    justify-content: center;
}

.interaction-bar-btn:hover {
    background: #f0f2f5;
}

.interaction-bar-btn.active {
    color: #1877f2;
}

/* Comments */
.comments-section {
    background: #f8f9fa;
    padding: 12px 16px;
    border-top: 1px solid #eee;
}

.comment-input {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.comment-input-field {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 12px;
    background: white;
    font-size: 14px;
    outline: none;
}

.comment-input-field:focus {
    border-color: #1877f2;
}

.comment-card {
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 12px;
    border: 1px solid #eee;
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1877f2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    margin-right: 8px;
}

.comment-info {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    color: #1c1e21;
    font-size: 13px;
    margin: 0;
}

.comment-meta {
    color: #65676b;
    font-size: 11px;
    margin: 0;
}

.comment-content {
    color: #1c1e21;
    font-size: 14px;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.comment-actions {
    display: flex;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid #f0f2f5;
}

.comment-action-btn {
    background: none;
    border: none;
    color: #65676b;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.comment-action-btn:hover {
    background: #f0f2f5;
}

.comment-action-btn.active {
    color: #1877f2;
}

/* Load More */
.load-more-btn {
    width: 100%;
    padding: 12px;
    background: #f0f2f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #65676b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
}

.load-more-btn:hover {
    background: #e4e6ea;
}

/* Floating Button */
.floating-add-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1877f2;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

.floating-add-btn:hover {
    transform: scale(1.05);
}

/* Popup */
.interactions-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.interactions-popup.show {
    display: flex;
}

.interactions-popup-content {
    background: white;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.interactions-popup-header {
    padding: 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.interactions-popup-title {
    font-weight: 600;
    color: #1c1e21;
    margin: 0;
}

.interactions-popup-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #65676b;
    cursor: pointer;
    padding: 4px;
}

.interactions-popup-body {
    padding: 16px;
    max-height: 60vh;
    overflow-y: auto;
}

.interactions-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.interaction-filter-btn {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: white;
    color: #65676b;
    font-size: 12px;
    cursor: pointer;
}

.interaction-filter-btn.active {
    background: #1877f2;
    color: white;
    border-color: #1877f2;
}

.interactions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.interaction-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 6px;
    background: #f8f9fa;
}

.interaction-emoji {
    font-size: 16px;
    margin-right: 8px;
}

.interaction-user {
    flex: 1;
    font-size: 13px;
    color: #1c1e21;
}

.interaction-time {
    font-size: 11px;
    color: #65676b;
}

/* Empty States */
.empty-posts {
    text-align: center;
    padding: 60px 20px;
    color: #65676b;
}

.empty-posts i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-comments {
    text-align: center;
    padding: 20px;
    color: #65676b;
    font-size: 13px;
}

/* Loading States */
.loading-posts {
    text-align: center;
    padding: 40px 20px;
    color: #65676b;
}

.loading-comments {
    text-align: center;
    padding: 20px;
    color: #65676b;
    font-size: 13px;
}

/* Messages */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 16px 0;
    border: 1px solid #ffcdd2;
}

.success-message {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 16px 0;
    border: 1px solid #c8e6c9;
}

/* DevExtreme */
.dx-popup-content {
    direction: rtl;
}

.dx-field-label {
    font-weight: 600;
    color: #1c1e21;
}

.dx-textbox,
.dx-textarea,
.dx-selectbox {
    border-radius: 6px;
}

.dx-button {
    border-radius: 6px;
    font-weight: 600;
}

/* RTL */
[dir="rtl"] .post-avatar,
[dir="rtl"] .comment-avatar {
    margin-right: 0;
    margin-left: 8px;
}

[dir="rtl"] .post-type-badge {
    right: auto;
    left: 16px;
}

[dir="rtl"] .status-badge {
    left: auto;
    right: 16px;
}

[dir="rtl"] .interaction-emoji {
    margin-right: 0;
    margin-left: 8px;
}

/* Mobile */
@media (max-width: 768px) {
    .main-container {
        padding: 10px;
    }
    
    .floating-add-btn {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}