/**
 * Tool Save Helper - Estilos do Sistema de Salvamento de Resultados
 *
 * @version 1.0.0
 * @date 2026-02-02
 */

/* ======================================
   BOTÃO FLUTUANTE "SALVAR NO DIÁRIO"
   ====================================== */

.tool-save-button-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tool-save-button-wrapper.show {
    opacity: 1;
    transform: translateY(0);
}

.btn-save-to-diario {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.btn-save-to-diario:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-save-to-diario:active {
    transform: translateY(0);
}

.btn-save-icon {
    font-size: 1.25rem;
}

.btn-save-text {
    font-weight: 600;
}

/* ======================================
   MODAIS
   ====================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    opacity: 1;
}

.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);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

/* Header do Modal */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 20px;
    border-bottom: 1px solid #e4e6eb;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #050505;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #65676b;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f0f2f5;
    color: #050505;
}

/* Body do Modal */
.modal-body {
    padding: 24px;
}

/* Footer do Modal */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #e4e6eb;
}

/* ======================================
   MODAL DE CONFIRMAÇÃO
   ====================================== */

.save-preview {
    background: linear-gradient(135deg, #f5f7ff 0%, #f0f4ff 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid #d0d9ff;
}

.preview-tool {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.tool-icon {
    font-size: 1.5rem;
}

.tool-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #050505;
}

.preview-summary {
    font-size: 0.9375rem;
    color: #4a5568;
    line-height: 1.5;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

/* Formulário */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #050505;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccd0d5;
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.char-count {
    text-align: right;
    font-size: 0.8125rem;
    color: #65676b;
    margin-top: 6px;
}

.error-message {
    background: #fee;
    color: #c41e3a;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 3px solid #c41e3a;
    margin-top: 16px;
    font-size: 0.9375rem;
}

/* ======================================
   MODAL DE SUCESSO
   ====================================== */

.modal-save-success .modal-content {
    max-width: 500px;
}

.success-message {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: scaleIn 0.5s ease;
}

.success-message p {
    font-size: 1.125rem;
    color: #4a5568;
    line-height: 1.6;
    margin: 0;
}

.success-message strong {
    color: #667eea;
    font-weight: 600;
}

/* ======================================
   MODAL DE UPSELL
   ====================================== */

.modal-upsell .modal-content {
    max-width: 700px;
}

.upsell-intro {
    margin-bottom: 24px;
}

.upsell-intro p {
    font-size: 1rem;
    color: #4a5568;
    line-height: 1.6;
    margin: 0;
}

.upsell-benefits {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 12px;
    padding: 20px 24px;
    margin: 24px 0;
    border: 1px solid #bbf7d0;
}

.upsell-benefits h4 {
    margin: 0 0 16px 0;
    font-size: 1.125rem;
    color: #050505;
}

.upsell-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.upsell-benefits li {
    padding: 8px 0;
    font-size: 0.9375rem;
    color: #4a5568;
    line-height: 1.5;
}

.upsell-benefits li::before {
    content: '✓ ';
    color: #10b981;
    font-weight: bold;
    margin-right: 8px;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

/* ======================================
   BOTÕES
   ====================================== */

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #e4e6eb;
    color: #050505;
}

.btn-secondary:hover {
    background: #d8dadf;
}

.btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.125rem;
}

/* ======================================
   NOTIFICAÇÕES
   ====================================== */

.tool-save-notification {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 16px 20px;
    display: none;
    opacity: 0;
    transform: translateX(100px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tool-save-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-icon {
    font-size: 1.5rem;
}

.notification-message {
    font-size: 0.9375rem;
    color: #050505;
    font-weight: 500;
}

.tool-save-notification.type-success {
    border-left: 4px solid #10b981;
}

.tool-save-notification.type-error {
    border-left: 4px solid #ef4444;
}

.tool-save-notification.type-info {
    border-left: 4px solid #3b82f6;
}

/* ======================================
   RESPONSIVIDADE
   ====================================== */

@media (max-width: 768px) {
    .tool-save-button-wrapper {
        bottom: 16px;
        right: 16px;
    }

    .btn-save-to-diario {
        padding: 12px 20px;
        font-size: 0.9375rem;
    }

    .btn-save-text {
        display: none;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 20px 16px 16px;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }

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

    .modal-footer {
        flex-direction: column;
        padding: 16px;
    }

    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .tool-save-notification {
        right: 12px;
        left: 12px;
        top: 16px;
    }
}

/* ======================================
   ANIMAÇÕES
   ====================================== */

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
