/* Post Push Notifications - Frontend Styles */

/* Contenedor principal de suscripción */
.ppn-subscription-box {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ppn-subscription-box.ppn-layout-vertical {
    flex-direction: column;
    align-items: stretch;
}

.ppn-subscription-box.ppn-layout-horizontal {
    flex-direction: row;
    align-items: center;
}

/* Botones principales */
.ppn-subscribe-btn,
.ppn-count-btn {
    border: none;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    outline: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Botón de suscripción */
.ppn-subscribe-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid transparent;
}

.ppn-subscribe-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.ppn-subscribe-btn:active {
    transform: translateY(0);
}

.ppn-subscribe-btn.subscribed {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

.ppn-subscribe-btn.subscribed .ppn-btn-icon {
    animation: checkmark 0.5s ease-in-out;
}

/* Botón de contador */
.ppn-count-btn {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #e9ecef;
}

.ppn-count-btn:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

/* Iconos y texto */
.ppn-btn-icon {
    font-size: 16px;
    line-height: 1;
}

.ppn-btn-text,
.ppn-count-text {
    font-size: 14px;
    line-height: 1;
}

.ppn-count-number {
    font-size: 16px;
    font-weight: bold;
    color: #667eea;
}

/* Modal de suscripción */
.ppn-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.ppn-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ppn-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ppn-modal-header {
    padding: 20px 20px 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.ppn-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.ppn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.ppn-close:hover {
    background: #f1f1f1;
    color: #666;
}

.ppn-modal-body {
    padding: 20px;
}

.ppn-modal-body p {
    color: #666;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* Formulario */
.ppn-subscription-form {
    margin-bottom: 15px;
}

.ppn-form-group {
    margin-bottom: 15px;
}

.ppn-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.ppn-form-group input[type="email"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.ppn-form-group input[type="email"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ppn-form-actions {
    display: flex;
    justify-content: flex-end;
}

.ppn-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 120px;
}

.ppn-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.ppn-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.ppn-btn-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Nota de permisos */
.ppn-permission-note {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.ppn-permission-note small {
    color: #666;
    font-size: 12px;
}

/* Estados de carga */
.ppn-loading {
    opacity: 0.7;
    pointer-events: none;
}

.ppn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes checkmark {
    0%, 50% { transform: scale(1); }
    25% { transform: scale(1.2); }
}

/* Mensajes de estado */
.ppn-message {
    padding: 12px 15px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 14px;
}

.ppn-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ppn-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Notificación popup */
.ppn-notification-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    max-width: 300px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.ppn-notification-content {
    padding: 15px;
}

.ppn-notification-content h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #333;
}

.ppn-notification-content p {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.ppn-notification-content button {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s ease;
}

.ppn-notification-content button:hover {
    background: #5a67d8;
}

/* Display simple de contador */
.ppn-count-display {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    font-size: 14px;
    color: #495057;
}

.ppn-count-display .ppn-count-number {
    font-weight: bold;
    color: #667eea;
}

/* Suscripción automática */
.ppn-auto-subscription {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* Responsive */
@media (max-width: 768px) {
    .ppn-subscription-box {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .ppn-subscribe-btn,
    .ppn-count-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }
    
    .ppn-modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .ppn-notification-popup {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .ppn-modal-header {
        padding: 15px 15px 0 15px;
    }
    
    .ppn-modal-body {
        padding: 15px;
    }
    
    .ppn-subscribe-btn,
    .ppn-count-btn {
        font-size: 13px;
        padding: 12px 16px;
    }
}
