/* ==================== COMUNIDADES - ESTILO RETRO TARINGA ==================== */

/* ==================== HERO SECTION ==================== */
.comunidades-hero {
    background: #FFFFFF;
    border: 1px solid #DDDDDD;
    border-bottom: 2px solid #2196F3;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.hero-content {
    flex: 1;
}

.hero-title {
    font-size: 22px;
    font-weight: bold;
    color: #2C3E50;
    margin-bottom: 8px;
}

.hero-title .fa {
    color: #2196F3;
    margin-right: 10px;
}

.hero-subtitle {
    font-size: 12px;
    color: #7F8C8D;
}

.btn-create-community {
    padding: 10px 20px;
    background: #4CAF50;
    border: 1px solid #388E3C;
    color: white;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-create-community:hover {
    background: #66BB6A;
}

.btn-create-community .fa {
    margin-right: 6px;
}

/* ==================== BÚSQUEDA Y FILTROS ==================== */
.search-filters {
    background: #FFFFFF;
    border: 1px solid #DDDDDD;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    display: flex;
    gap: 8px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #757575;
    pointer-events: none;
}

.search-input {
    flex: 1;
    padding: 8px 10px 8px 35px;
    font-size: 12px;
    border: 1px solid #DDDDDD;
    background: #FFFFFF;
}

.search-input:focus {
    outline: none;
    border-color: #2196F3;
}

.search-btn {
    padding: 8px 15px;
    background: #2196F3;
    border: 1px solid #1976D2;
    color: white;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.search-btn:hover {
    background: #1976D2;
}

.search-btn .fa {
    margin-right: 5px;
}

.filters {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filters label {
    font-size: 11px;
    font-weight: bold;
    color: #2C3E50;
    white-space: nowrap;
}

.filters label .fa {
    color: #2196F3;
    margin-right: 4px;
}

.filter-select {
    padding: 8px 10px;
    font-size: 12px;
    border: 1px solid #DDDDDD;
    background: #FFFFFF;
}

.filter-select:focus {
    outline: none;
    border-color: #2196F3;
}

/* ==================== GRID DE COMUNIDADES ==================== */
.comunidades-section {
    margin-bottom: 30px;
}

.comunidades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

/* Tarjeta de comunidad */
.comunidad-card {
    background: #FFFFFF;
    border: 1px solid #DDDDDD;
    padding: 15px;
    cursor: pointer;
    transition: all 0.1s;
}

.comunidad-card:hover {
    background: #F8F9FA;
    border-color: #2196F3;
}

.comunidad-image {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F5F5F5;
    border: 1px solid #E0E0E0;
    margin-bottom: 12px;
    font-size: 40px;
    color: #2196F3;
}

.comunidad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comunidad-image .fa {
    font-size: 48px;
    color: #2196F3;
}

.comunidad-name {
    font-size: 15px;
    font-weight: bold;
    color: #2C3E50;
    margin-bottom: 8px;
    line-height: 1.3;
}

.comunidad-description {
    font-size: 12px;
    color: #7F8C8D;
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.comunidad-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #EEEEEE;
    font-size: 11px;
    color: #757575;
}

.comunidad-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.comunidad-stat .fa {
    font-size: 13px;
}

.comunidad-members .fa { color: #2196F3; }
.comunidad-posts .fa { color: #FF9800; }

/* Badge de miembro */
.member-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    background: #4CAF50;
    color: white;
    font-size: 9px;
    font-weight: bold;
    margin-left: 8px;
}

.member-badge .fa {
    font-size: 8px;
}

/* ==================== MIS COMUNIDADES ==================== */
.mis-comunidades-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    color: #2C3E50;
    padding: 12px 15px;
    background: #F8F9FA;
    border: 1px solid #DDDDDD;
    border-bottom: 2px solid #2196F3;
    margin-bottom: 15px;
}

.section-title .fa {
    color: #FFD700;
    margin-right: 8px;
}

.comunidades-grid-small {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

/* ==================== MODAL ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal-content {
    background: #FFFFFF;
    border: 2px solid #2196F3;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #F8F9FA;
    border-bottom: 1px solid #DDDDDD;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: bold;
    color: #2C3E50;
    margin: 0;
}

.modal-header h2 .fa {
    color: #2196F3;
    margin-right: 8px;
}

.modal-close {
    background: #F44336;
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #D32F2F;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: #F8F9FA;
    border-top: 1px solid #DDDDDD;
}

/* ==================== FORMULARIO ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    color: #2C3E50;
    margin-bottom: 6px;
}

.form-group label .fa {
    color: #2196F3;
    margin-right: 5px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    font-family: Verdana, Tahoma, Arial, sans-serif;
    border: 1px solid #DDDDDD;
    background: #FFFFFF;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #2196F3;
}

.form-textarea {
    resize: vertical;
    line-height: 1.5;
}

.form-hint {
    font-size: 11px;
    color: #757575;
    margin-top: 4px;
}

.form-info {
    background: #E3F2FD;
    border-left: 3px solid #2196F3;
    padding: 12px;
    margin-top: 15px;
}

.form-info strong {
    display: block;
    font-size: 12px;
    color: #2C3E50;
    margin-bottom: 8px;
}

.form-info strong .fa {
    color: #2196F3;
    margin-right: 5px;
}

.form-info ul {
    margin-left: 20px;
    font-size: 11px;
    color: #616161;
}

.form-info li {
    margin-bottom: 4px;
}

/* ==================== BOTONES ==================== */
.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 10px 15px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid;
}

.btn-primary {
    background: #2196F3;
    border-color: #1976D2;
    color: white;
}

.btn-primary:hover {
    background: #1976D2;
}

.btn-secondary {
    background: #FFFFFF;
    border-color: #DDDDDD;
    color: #2C3E50;
}

.btn-secondary:hover {
    background: #F8F9FA;
}

.btn-primary .fa,
.btn-secondary .fa {
    margin-right: 5px;
}

/* ==================== DETALLE DE COMUNIDAD ==================== */
.comunidad-detail-header {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #EEEEEE;
}

.comunidad-detail-image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F5F5F5;
    border: 2px solid #DDDDDD;
    font-size: 60px;
    color: #2196F3;
}

.comunidad-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comunidad-detail-image .fa {
    font-size: 64px;
}

.comunidad-detail-info {
    flex: 1;
}

.comunidad-description {
    font-size: 13px;
    color: #2C3E50;
    line-height: 1.5;
    margin-bottom: 15px;
}

.comunidad-stats-detail {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 10px 0;
}

.comunidad-stats-detail .stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #2C3E50;
}

.comunidad-stats-detail .stat-icon {
    font-size: 16px;
    color: #2196F3;
}

.comunidad-actions {
    display: flex;
    gap: 10px;
}

.comunidad-actions button {
    padding: 8px 15px;
    font-size: 12px;
}

/* ==================== TABS DE DETALLE ==================== */
.comunidad-detail-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 2px solid #EEEEEE;
}

.detail-tab {
    padding: 10px 15px;
    background: none;
    border: none;
    color: #757575;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.detail-tab:hover {
    color: #2196F3;
}

.detail-tab.active {
    color: #2196F3;
    border-bottom-color: #2196F3;
}

.detail-tab .fa {
    margin-right: 5px;
}

.comunidad-detail-content {
    min-height: 300px;
}

.detail-content {
    display: none;
}

.detail-content.active {
    display: block;
}

/* ==================== LOADING Y EMPTY STATES ==================== */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #757575;
    font-size: 13px;
}

.loading .fa {
    margin-right: 8px;
    color: #2196F3;
    font-size: 18px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7F8C8D;
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-icon .fa {
    font-size: 60px;
}

.empty-title {
    font-size: 18px;
    font-weight: bold;
    color: #2C3E50;
    margin-bottom: 10px;
}

.empty-message {
    font-size: 13px;
    color: #7F8C8D;
}

/* ==================== LISTA DE MIEMBROS ==================== */
.members-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.member-item {
    background: #F8F9FA;
    border: 1px solid #DDDDDD;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.member-avatar {
    width: 40px;
    height: 40px;
    background: #2196F3;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
}

.member-info {
    flex: 1;
}

.member-name {
    font-size: 12px;
    font-weight: bold;
    color: #2C3E50;
}

.member-role {
    font-size: 10px;
    color: #757575;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .comunidades-hero {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-create-community {
        width: 100%;
        text-align: center;
    }
    
    .search-filters {
        flex-direction: column;
    }
    
    .search-box {
        width: 100%;
    }
    
    .filters {
        width: 100%;
        justify-content: space-between;
    }
    
    .comunidades-grid {
        grid-template-columns: 1fr;
    }
    
    .comunidades-grid-small {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .comunidad-detail-header {
        flex-direction: column;
    }
    
    .comunidad-detail-image {
        width: 100%;
        height: 150px;
    }
    
    .comunidad-actions {
        flex-direction: column;
    }
    
    .modal-footer {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 20px;
    }
    
    .comunidad-card {
        padding: 12px;
    }
    
    .comunidad-stats {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .modal {
        padding: 10px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .comunidad-detail-tabs {
        flex-direction: column;
        gap: 0;
    }
    
    .detail-tab {
        text-align: left;
        border-bottom: 1px solid #EEEEEE;
        margin-bottom: 0;
    }
    
    .members-list {
        grid-template-columns: 1fr;
    }
}

/* ==================== ANIMACIONES ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comunidad-card {
    animation: fadeIn 0.3s ease-out;
}