* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 25% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
                      radial-gradient(circle at 75% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

.dashboard-header {
    position: relative;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
    z-index: 20;
}

.header-glow {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.8), transparent);
}

.stats-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(30, 41, 59, 0.5);
    padding: 6px 14px;
    border-radius: 100px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #94a3b8;
}

.stat-value {
    font-weight: 700;
    color: white;
    font-size: 14px;
}

.stat-icon {
    color: #8b5cf6;
    font-size: 12px;
}

.glass {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.create-post-card {
    transition: all 0.3s;
}

.user-avatar-sm {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.post-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 12px 16px;
    color: white;
    font-size: 14px;
    resize: vertical;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.post-input:focus {
    outline: none;
    border-color: #8b5cf6;
    background: rgba(15, 23, 42, 0.8);
}

.category-select {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 100px;
    padding: 8px 16px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}

.post-btn {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border: none;
    border-radius: 100px;
    padding: 8px 20px;
    color: white;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.post-btn:active {
    transform: scale(0.96);
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.filter-btn {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 100px;
    padding: 6px 14px;
    color: #94a3b8;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.filter-btn:active {
    transform: scale(0.96);
}

.filter-btn.active {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border-color: transparent;
}

.post-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.post-card:active {
    transform: scale(0.99);
}

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

.post-author {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.author-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.author-info {
    min-width: 0;
    flex: 1;
}

.author-name {
    color: white;
    font-weight: 600;
    font-size: 13px;
    word-break: break-word;
}

.post-time {
    color: #64748b;
    font-size: 9px;
    display: block;
}

.category-badge {
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.category-general { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }
.category-help { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.category-bug { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.category-feedback { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.category-command { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.category-deploy { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.category-feature { background: rgba(236, 72, 153, 0.2); color: #f472b6; }

.post-content {
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1.5;
    margin: 12px 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.action-btn {
    background: none;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 6px 0;
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn.liked {
    color: #ef4444;
}

.reply-count {
    margin-left: 2px;
}

.replies-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.reply-item {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
}

.reply-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.reply-avatar {
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: linear-gradient(135deg, #475569, #334155);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: white;
}

.reply-author {
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.reply-time {
    font-size: 9px;
    color: #64748b;
}

.reply-text {
    color: #94a3b8;
    font-size: 12px;
    margin-left: 36px;
    line-height: 1.5;
    word-break: break-word;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loading-ring {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top: 3px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-ring-inner {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(139, 92, 246, 0.2);
    border-top: 2px solid #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite reverse;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 16px;
    color: #94a3b8;
    font-size: 12px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-content-message {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    position: relative;
    animation: modalIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.modal-close:active {
    transform: scale(0.9);
}

.modal-header {
    padding: 20px 20px 12px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 {
    color: white;
    font-size: 16px;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
}

.original-post {
    background: rgba(139, 92, 246, 0.1);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 20px;
    font-size: 12px;
    color: #94a3b8;
    max-height: 120px;
    overflow-y: auto;
    word-break: break-word;
}

.message-textarea {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 12px;
    color: white;
    font-size: 13px;
    resize: vertical;
    font-family: 'Inter', sans-serif;
    -webkit-appearance: none;
    appearance: none;
}

.message-textarea:focus {
    outline: none;
    border-color: #8b5cf6;
}

.send-reply-btn {
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border: none;
    border-radius: 100px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.send-reply-btn:active {
    transform: scale(0.97);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 44px;
    color: #475569;
    margin-bottom: 16px;
}

.empty-state p {
    color: #94a3b8;
}

.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 640px) {
    .dashboard-header {
        padding: 12px 0;
    }
    
    .stats-bar {
        gap: 10px;
        padding: 5px 12px;
    }
    
    .create-post-card {
        padding: 16px;
    }
    
    .user-avatar-sm {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 14px;
    }
    
    .post-input {
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .post-btn {
        padding: 6px 16px;
        font-size: 12px;
    }
    
    .category-select {
        font-size: 11px;
        padding: 6px 12px;
        padding-right: 32px;
        background-size: 14px;
    }
    
    .filter-btn {
        font-size: 10px;
        padding: 5px 12px;
    }
    
    .post-card {
        padding: 14px;
        border-radius: 16px;
    }
    
    .author-avatar {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 12px;
    }
    
    .author-name {
        font-size: 12px;
    }
    
    .category-badge {
        font-size: 9px;
        padding: 3px 8px;
    }
    
    .post-content {
        font-size: 12px;
    }
    
    .action-btn {
        font-size: 11px;
    }
    
    .reply-item {
        padding: 10px;
    }
    
    .reply-author {
        font-size: 11px;
    }
    
    .reply-text {
        font-size: 11px;
        margin-left: 32px;
    }
    
    .modal-content-message {
        border-radius: 20px;
    }
    
    .modal-header {
        padding: 16px 16px 12px;
    }
    
    .modal-body {
        padding: 16px;
    }
}

/* Tablet optimization */
@media (min-width: 641px) and (max-width: 1024px) {
    .community-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Better touch targets for mobile */
button, 
.post-btn,
.filter-btn,
.action-btn,
.modal-close,
.send-reply-btn,
.category-select {
    touch-action: manipulation;
}

/* Prevent zoom on input focus on iOS */
@media (max-width: 768px) {
    input, textarea, select {
        font-size: 16px;
    }
}