/**
 * Community Platform main stylesheet
 */

/* General Styles */
.community-platform-home,
.community-platform-single,
.community-platform-interior,
.community-platform-room,
.community-platform-messaging {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
    line-height: 1.6;
    background-color: #f9f9f9;
    margin: 0;
    padding: 0;
}

/* Buttons */
.cp-button-primary,
.cp-button-secondary,
.cp-button-danger {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.cp-button-primary {
    background-color: #4a6bff;
    color: white;
}

.cp-button-primary:hover {
    background-color: #3a5bf9;
    color: white;
}

.cp-button-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.cp-button-secondary:hover {
    background-color: #e0e0e0;
    color: #333;
}

.cp-button-danger {
    background-color: #ff4a4a;
    color: white;
}

.cp-button-danger:hover {
    background-color: #e43b3b;
    color: white;
}

.cp-button-small {
    padding: 4px 12px;
    font-size: 12px;
}

.cp-button-large {
    padding: 12px 24px;
    font-size: 16px;
}

.cp-button-block {
    display: block;
    width: 100%;
}

.cp-button-icon {
    padding: 8px;
}

/* Loading indicator */
.cp-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.cp-loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4a6bff;
    border-radius: 50%;
    animation: cp-spin 1s linear infinite;
}

.cp-loading-inline {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.cp-loading-inline .cp-loading-spinner {
    width: 30px;
    height: 30px;
    border-width: 3px;
    margin-bottom: 10px;
}

@keyframes cp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal */
.cp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
}

.cp-modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cp-modal-large {
    width: 700px;
}

.cp-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cp-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.cp-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.cp-modal-body {
    padding: 20px;
    overflow-y: auto;
}

.cp-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Forms */
.cp-form-group {
    margin-bottom: 20px;
}

.cp-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.cp-form-group input[type="text"],
.cp-form-group input[type="email"],
.cp-form-group input[type="url"],
.cp-form-group input[type="number"],
.cp-form-group input[type="date"],
.cp-form-group input[type="time"],
.cp-form-group textarea,
.cp-form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.cp-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.cp-form-col {
    flex: 1;
}

.cp-form-col-2 {
    flex: 2;
}

.cp-form-actions {
    margin-top: 30px;
}

.cp-file-upload {
    display: flex;
    align-items: center;
}

.cp-file-upload input[type="file"] {
    display: none;
}

.cp-file-upload-label {
    display: inline-block;
    padding: 8px 16px;
    background-color: #f0f0f0;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

.cp-current-image {
    margin-top: 10px;
    max-width: 150px;
}

.cp-current-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Home Page Styles */
.cp-home-hero {
    background: linear-gradient(135deg, #4a6bff, #9747ff);
    color: white;
    padding: 80px 20px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 40px;
}

.cp-home-hero h1 {
    font-size: 36px;
    margin-bottom: 16px;
}

.cp-home-hero-subtitle {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 30px;
}

.cp-home-search {
    max-width: 600px;
    margin: 0 auto;
}

.cp-search-input-wrapper {
    position: relative;
}

.cp-search-input-wrapper input {
    width: 100%;
    padding: 14px 20px;
    padding-right: 50px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cp-search-input-wrapper button,
.cp-search-input-wrapper .dashicons {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
}

.cp-home-section {
    margin-bottom: 60px;
}

.cp-home-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.cp-home-section-header h2 {
    font-size: 24px;
    margin: 0;
}

.cp-communities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.cp-community-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cp-community-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.cp-community-card-cover {
    height: 160px;
    position: relative;
}

.cp-community-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cp-community-card-placeholder {
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cp-community-card-placeholder .dashicons {
    font-size: 48px;
    color: #ccc;
}

.cp-community-visibility {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.cp-community-visibility.public {
    background-color: rgba(74, 222, 128, 0.2);
    color: #22c55e;
}

.cp-community-visibility.private {
    background-color: rgba(248, 113, 113, 0.2);
    color: #ef4444;
}

.cp-visibility-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 5px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.public .cp-visibility-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' d='M0 0h24v24H0z'/%3E%3Cpath d='M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z' fill='%2322c55e'/%3E%3C/svg%3E");
}

.private .cp-visibility-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' d='M0 0h24v24H0z'/%3E%3Cpath d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z' fill='%23ef4444'/%3E%3C/svg%3E");
}

.cp-community-card-details {
    padding: 20px;
}

.cp-community-card-name {
    font-size: 18px;
    margin: 0 0 10px 0;
}

.cp-community-card-name a {
    color: #333;
    text-decoration: none;
}

.cp-community-card-name a:hover {
    color: #4a6bff;
}

.cp-community-card-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.cp-community-card-stats {
    display: flex;
    gap: 20px;
}

.cp-card-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cp-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.cp-stat-label {
    font-size: 12px;
    color: #666;
}

.cp-community-card-action {
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
    text-align: right;
}

.cp-no-communities {
    text-align: center;
    padding: 40px 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.cp-home-cta {
    background: linear-gradient(135deg, #4a6bff, #9747ff);
    color: white;
    padding: 60px 20px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 40px;
}

.cp-home-cta h2 {
    font-size: 28px;
    margin-bottom: 16px;
}

.cp-home-cta p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.cp-home-cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Responsive styles for the home page */
@media (max-width: 768px) {
    .cp-home-hero h1 {
        font-size: 28px;
    }
    
    .cp-home-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .cp-communities-grid {
        grid-template-columns: 1fr;
    }
    
    .cp-home-cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
}

