/* Estilos para el plugin de notificaciones Condo360 */

.condo360-notifications-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Estado de conexión WhatsApp */
.condo360-whatsapp-status {
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.2);
}

.whatsapp-status-container h3 {
    color: white;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.whatsapp-status-container h3::before {
    content: "📱";
    font-size: 20px;
}

#whatsapp-status-content {
    color: white;
    font-size: 14px;
}

.status-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
}

.status-loading .icon-loading {
    animation: spin 1s linear infinite;
}

.status-connected {
    color: #FFFFFF;
    font-weight: 700;
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 8px;
}

.status-connected::before {
    content: "✅";
    font-size: 16px;
    margin-right: 8px;
}

.status-disconnected {
    color: #FFE082;
    font-weight: 700;
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    background: rgba(255, 224, 130, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 8px;
}

.status-disconnected::before {
    content: "⚠️";
    font-size: 16px;
    margin-right: 8px;
}

.status-error {
    color: #FFCDD2;
    font-weight: 700;
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    background: rgba(255, 205, 210, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 8px;
}

.status-error::before {
    content: "❌";
    font-size: 16px;
    margin-right: 8px;
}

.whatsapp-reconnect-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.whatsapp-reconnect-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.whatsapp-reconnect-btn::before {
    content: "🔗";
    font-size: 14px;
}

.whatsapp-user-info {
    color: #E8F5E8;
    font-size: 13px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 8px;
    display: inline-block;
}

.whatsapp-disconnect-notice {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
    color: #E8F5E8;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 500;
}

.whatsapp-disconnect-notice strong {
    color: #FFE082;
    font-weight: 600;
}

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

.condo360-notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e1e5e9;
}

.condo360-notifications-header h2 {
    color: #2c3e50;
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

.condo360-notifications-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-warning {
    background-color: #f39c12;
    color: white;
}

.btn-warning:hover {
    background-color: #e67e22;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Dashboard */
.condo360-notifications-dashboard {
    margin-bottom: 40px;
}

.condo360-notifications-dashboard h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 20px;
}

.dashboard-notifications {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.notification-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.notification-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.notification-card.active {
    border-left: 4px solid #27ae60;
}

.notification-card.inactive {
    border-left: 4px solid #e74c3c;
}

.notification-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.notification-description {
    color: #7f8c8d;
    line-height: 1.5;
    margin-bottom: 15px;
}

.notification-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #95a5a6;
}

.notification-time {
    display: flex;
    align-items: center;
    gap: 5px;
}

.notification-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.notification-status.active {
    background-color: #d5f4e6;
    color: #27ae60;
}

.notification-status.inactive {
    background-color: #fadbd8;
    color: #e74c3c;
}

.notification-status.programada {
    background-color: #fff3cd;
    color: #856404;
}

.notification-status.expirada {
    background-color: #e2e3e5;
    color: #383d41;
}

/* Management */
.condo360-notifications-management h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 20px;
}

.notifications-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.form-control {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.notifications-list {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
}

.notification-item {
    padding: 20px;
    border-bottom: 1px solid #e1e5e9;
    transition: background-color 0.2s ease;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 15px;
}

.notification-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    padding-right: 10px;
}

.notification-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.notification-item-description {
    color: #7f8c8d;
    margin-bottom: 15px;
    line-height: 1.4;
}

.notification-item-dates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    font-size: 12px;
    color: #95a5a6;
}

.date-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.date-label {
    font-weight: 500;
    color: #7f8c8d;
}

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

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 95%;
    max-width: 900px;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

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

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
}

.close {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #95a5a6;
    transition: color 0.2s ease;
}

.close:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 20px;
}

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

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
}

/* Pagination */
.pagination-container {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 5px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.pagination button:hover {
    background-color: #f8f9fa;
}

.pagination button.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background-color: #27ae60;
}

.toast.error {
    background-color: #e74c3c;
}

.toast.warning {
    background-color: #f39c12;
}

.toast.info {
    background-color: #3498db;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-style: italic;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Error */
.condo360-notifications-error {
    background-color: #fadbd8;
    color: #e74c3c;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    text-align: center;
    font-weight: 500;
}

.error {
    background-color: #fadbd8;
    color: #e74c3c;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    text-align: center;
    font-weight: 500;
    margin: 10px 0;
}

.no-notifications {
    background-color: #e8f4fd;
    color: #2980b9;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #bee5eb;
    text-align: center;
    font-style: italic;
    margin: 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .condo360-notifications-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .condo360-notifications-actions {
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .notifications-filters {
        flex-direction: column;
    }
    
    .notification-item-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .notification-item-actions {
        align-self: flex-end;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .dashboard-notifications {
        grid-template-columns: 1fr;
    }
}

/* Icons */
.icon-plus::before { content: '+'; }
.icon-refresh::before { content: '↻'; }
.icon-edit::before { content: '✏️'; }
.icon-delete::before { content: '🗑️'; }
.icon-view::before { content: '👁️'; }
.icon-time::before { content: '🕒'; }
.icon-calendar::before { content: '📅'; }

/* Modal específico de Condo360 */
.condo360-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.condo360-modal-content {
    background-color: white;
    border-radius: 8px;
    width: 95%;
    max-width: 900px;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

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

.condo360-modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
}

.condo360-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.condo360-close:hover {
    color: #e74c3c;
}

.condo360-modal-body {
    padding: 20px;
}

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

/* Modal específico para detalles de notificación */
.condo360-details-modal-content {
    max-width: 600px;
}

.condo360-modal-header {
    position: relative;
}

.condo360-modal-header h3 {
    padding-right: 40px;
    word-wrap: break-word;
}

.condo360-close {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* Estilos específicos para detalles de notificación */
.notification-details {
    line-height: 1.6;
}

.notification-details h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.notification-details p {
    margin-bottom: 12px;
    padding: 8px 0;
}

.notification-details strong {
    color: #34495e;
    font-weight: 600;
    display: inline-block;
    min-width: 120px;
}

/* Sección de permisos de notificaciones */
.condo360-permissions-section {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #17a2b8;
}

.condo360-permissions-section .btn {
    margin-right: 10px;
}

.permission-status {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
}

.permission-status.granted {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.permission-status.denied {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.permission-status.default {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    display: block;
}

.icon-bell::before { content: '🔔'; }
