/**
 * Cohesio Plugin Styles
 * Modern, responsive design inspired by Skool.com
 */

/* Reset and Base Styles */
.cohesio-communities,
.cohesio-community,
.cohesio-post {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.cohesio-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
}

.cohesio-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.cohesio-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

/* Category Filter */
.cohesio-categories {
    margin-bottom: 30px;
}

.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 2px solid #e1e5e9;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #666;
}

.category-btn:hover,
.category-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.category-icon {
    font-size: 1.2rem;
}

/* Search */
.cohesio-search {
    margin-bottom: 30px;
    text-align: center;
}

.cohesio-search input {
    width: 100%;
    max-width: 500px;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.cohesio-search input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Communities Grid */
.cohesio-communities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.cohesio-community-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.cohesio-community-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.community-header {
    padding: 25px;
}

.community-image {
    width: 100%;
    height: 200px;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
}

.community-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.community-category {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #666;
}

.community-name {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
}

.community-description {
    color: #666;
    margin: 0 0 15px 0;
    line-height: 1.5;
}

.community-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.member-count {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-size: 0.9rem;
}

.community-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    border-top: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.community-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: #667eea;
}

.community-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    line-height: 1;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Single Community View */
.cohesio-community {
    max-width: 100%;
}

.community-banner {
    width: 100%;
    height: 300px;
    margin-bottom: 30px;
    border-radius: 16px;
    overflow: hidden;
}

.community-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.community-info {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.community-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.community-category {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #666;
}

.community-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-public {
    background: #d4edda;
    color: #155724;
}

.status-private {
    background: #fff3cd;
    color: #856404;
}

.status-paid {
    background: #cce5ff;
    color: #004085;
}

.community-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #333;
}

.community-description {
    font-size: 1.1rem;
    color: #666;
    margin: 0 0 25px 0;
    line-height: 1.6;
}

.community-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.community-actions {
    display: flex;
    gap: 15px;
}

/* Community Layout */
.community-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

.community-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-widget {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.sidebar-widget h3 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.community-details p {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #666;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Posts Feed */
.community-main {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.posts-feed {
    padding: 25px;
}

.posts-feed h3 {
    margin: 0 0 25px 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}

/* Create Post Form */
.create-post-form {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 2px dashed #e1e5e9;
}

.create-post-form h3 {
    margin: 0 0 20px 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* Post Cards */
.post-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.post-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.post-date {
    font-size: 0.85rem;
    color: #666;
}

.post-actions {
    display: flex;
    gap: 10px;
}

.post-action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid #e1e5e9;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    color: #666;
}

.post-action-btn:hover,
.post-action-btn.liked {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.post-content {
    margin-bottom: 20px;
}

.post-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
}

.post-text {
    color: #555;
    line-height: 1.6;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.post-stats {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: #666;
}

.post-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    color: #666;
    text-decoration: none;
}

.action-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

/* Comments */
.comments-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.comments-list {
    margin-bottom: 20px;
}

.comment {
    padding: 15px 0;
    border-bottom: 1px solid #f8f9fa;
}

.comment:last-child {
    border-bottom: none;
}

.comment-header {
    margin-bottom: 10px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-author .author-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.comment-author .author-name {
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.comment-date {
    font-size: 0.8rem;
    color: #666;
}

.comment-content {
    color: #555;
    line-height: 1.5;
    margin-left: 42px;
}

.comment-form {
    margin-top: 20px;
}

.comment-input {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.comment-input textarea {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
}

.comment-input textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Modal */
.cohesio-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #e1e5e9;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #333;
}

.modal-content form {
    padding: 30px;
}

/* Load More */
.cohesio-load-more {
    text-align: center;
    margin: 40px 0;
}

/* Create Community */
.cohesio-create-community {
    text-align: center;
    margin: 40px 0;
    padding: 40px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    border: 2px dashed #dee2e6;
}

/* No Content States */
.no-posts,
.no-comments,
.no-communities {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    background: white;
    border-radius: 12px;
    border: 2px dashed #e1e5e9;
    margin: 20px 0;
}

.no-posts p,
.no-comments p,
.no-communities p {
    margin: 0 0 20px 0;
    font-size: 1.1rem;
}

.no-communities h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cohesio-communities,
    .cohesio-community,
    .cohesio-post {
        padding: 15px;
    }
    
    .cohesio-header h1 {
        font-size: 2rem;
    }
    
    .cohesio-communities-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .community-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .community-sidebar {
        order: -1;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .community-stats {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .community-actions {
        flex-direction: column;
    }
    
    .post-footer {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .comment-input {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-content form {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .category-filter {
        flex-direction: column;
        align-items: center;
    }
    
    .category-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
    
    .community-footer {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .community-actions {
        flex-direction: column;
    }
}

/* Loading States */
.cohesio-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.cohesio-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error Messages */
.cohesio-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.cohesio-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cohesio-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Breadcrumb */
.post-breadcrumb {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #666;
}

.post-breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.post-breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 8px;
}

/* Comment Login Notice */
.comment-login-notice {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #e1e5e9;
}

.comment-login-notice p {
    margin: 0 0 15px 0;
    color: #666;
}
