/* Agent Solaire Premium - Chatbot Styles */
/* CSS Variables (set dynamically by PHP) */
:root {
    --asp-primary-color: #2E8B57;
    --asp-secondary-color: #F0F8EA;
    --asp-font-family: Arial, sans-serif;
    --asp-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --asp-border-radius: 12px;
    --asp-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Clignotement doux */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.asp-chatbot-toggle {
    animation: blink 2s infinite;
}
.asp-chatbot-toggle:hover {
    animation: none;
}
/* Chatbot toggle button */
.asp-chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--asp-primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--asp-shadow);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--asp-transition);
    border: none;
    outline: none;
}
.asp-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}
.asp-chatbot-toggle svg {
    fill: white;
    width: 28px;
    height: 28px;
}

/* Chatbot container */
.asp-chatbot-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 450px; /* Augmenté */
    max-width: calc(100vw - 40px);
    height: 700px; /* Augmenté */
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: var(--asp-border-radius);
    box-shadow: var(--asp-shadow);
    z-index: 999998;
    font-family: var(--asp-font-family);
    overflow: hidden;
    transition: var(--asp-transition);
    transform: translateY(10px);
    opacity: 0;
    pointer-events: none;
}
.asp-chatbot-container.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Chatbot widget */
.asp-chatbot-widget {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Header */
.asp-chatbot-header {
    background: var(--asp-primary-color);
    color: white;
    padding: 25px; /* Augmenté */
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}
.asp-chatbot-company-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}
.asp-chatbot-logo {
    width: 60px; /* Augmenté */
    height: 60px; /* Augmenté */
    border-radius: 20%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}
.asp-chatbot-company-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.asp-company-name {
    font-weight: 600;
    font-size: 18px; /* Augmenté */
    line-height: 1.3;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.asp-company-phone {
    font-size: 14px; /* Augmenté */
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.asp-chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 26px; /* Augmenté */
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.asp-chatbot-close:hover {
    opacity: 1;
}

/* Messages area */
.asp-chatbot-messages {
    flex: 1;
    padding: 25px; /* Augmenté */
    overflow-y: auto;
    background: var(--asp-secondary-color);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}
.asp-chatbot-messages::-webkit-scrollbar {
    width: 8px;
}
.asp-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}
.asp-chatbot-messages::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* Messages */
.asp-message {
    margin-bottom: 20px; /* Augmenté */
    display: flex;
    align-items: flex-end;
    gap: 10px; /* Augmenté */
    animation: messageSlideIn 0.3s ease-out;
}
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.asp-message-bot {
    justify-content: flex-start;
}
.asp-message-user {
    justify-content: flex-end;
}
.asp-message-bubble {
    max-width: 85%;
    padding: 16px 20px; /* Augmenté */
    border-radius: 20px; /* Arrondi légèrement plus important */
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 15px; /* Texte plus gros */
    position: relative;
}
.asp-message-bot .asp-message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.asp-message-user .asp-message-bubble {
    background: var(--asp-primary-color);
    color: white;
    border-bottom-right-radius: 6px;
}

/* Typing indicator */
.asp-typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 16px 20px; /* Augmenté */
    background: white;
    border-radius: 20px; /* Un peu plus rond */
    border-bottom-left-radius: 6px;
    max-width: 80px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.asp-typing-dot {
    width: 10px; /* Augmenté */
    height: 10px; /* Augmenté */
    border-radius: 50%;
    background: #999;
    animation: typingDot 1.4s infinite both;
}
.asp-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.asp-typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes typingDot {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Input area */
.asp-chatbot-input-area {
    padding: 20px; /* Augmenté */
    background: white;
    border-top: 1px solid #e5e5e5;
}
.asp-chatbot-input-container {
    display: flex;
    gap: 15px; /* Augmenté */
    align-items: center;
}
#asp-chatbot-input {
    flex: 1;
    padding: 16px 20px; /* Augmenté */
    border: 2px solid #e5e5e5;
    border-radius: 30px; /* Un peu plus rond */
    font-size: 16px; /* Texte plus gros dans l’input */
    font-family: var(--asp-font-family);
    outline: none;
    transition: border-color 0.2s;
}
#asp-chatbot-input:focus {
    border-color: var(--asp-primary-color);
}
#asp-chatbot-input::placeholder {
    color: #999;
}
.asp-chatbot-send-btn {
    background: var(--asp-primary-color);
    border: none;
    border-radius: 50%;
    width: 50px; /* Augmenté */
    height: 50px; /* Augmenté */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--asp-transition);
    color: white;
}
.asp-chatbot-send-btn:hover {
    background: color-mix(in srgb, var(--asp-primary-color) 85%, black);
    transform: scale(1.05);
}
.asp-chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Footer with action buttons */
.asp-chatbot-footer {
    padding: 20px; /* Augmenté */
    background: white;
    border-top: 1px solid #e5e5e5;
}
.asp-footer-btn {
    display: block;
    width: 100%;
    padding: 16px 20px; /* Augmenté */
    margin-bottom: 10px;
    background: transparent;
    border: 2px solid var(--asp-primary-color);
    color: var(--asp-primary-color);
    border-radius: 10px; /* Un peu plus arrondi */
    cursor: pointer;
    font-size: 15px; /* Texte plus gros */
    font-weight: 500;
    transition: var(--asp-transition);
    text-align: left;
}
.asp-footer-btn:last-child {
    margin-bottom: 0;
}
.asp-footer-btn:hover {
    background: var(--asp-primary-color);
    color: white;
    transform: translateY(-1px);
}

/* Modals */
.asp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}
.asp-modal-content {
    background: white;
    border-radius: var(--asp-border-radius);
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
.asp-modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--asp-primary-color);
    font-size: 22px;
    font-weight: 600;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}
.asp-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}
.asp-close:hover {
    color: #333;
}

/* Forms */
.asp-form {
    font-family: var(--asp-font-family);
}
.asp-form-group {
    margin-bottom: 25px; /* Augmenté */
}
.asp-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}
.asp-form-group input,
.asp-form-group select {
    width: 100%;
    padding: 14px 18px; /* Augmenté */
    border: 2px solid #e5e5e5;
    border-radius: 10px; /* Un peu plus rond */
    font-size: 15px; /* Augmenté */
    font-family: var(--asp-font-family);
    transition: border-color 0.2s;
}
.asp-form-group input:focus,
.asp-form-group select:focus {
    outline: none;
    border-color: var(--asp-primary-color);
}
.asp-form-group input[type="checkbox"] {
    width: auto;
    margin-right: 10px; /* Augmenté */
}
.asp-form-actions {
    display: flex;
    gap: 15px; /* Augmenté */
    margin-top: 30px; /* Augmenté */
    flex-wrap: wrap;
}
.asp-btn {
    padding: 14px 26px; /* Augmenté */
    border: none;
    border-radius: 10px; /* Un peu plus rond */
    font-size: 15px; /* Augmenté */
    font-weight: 500;
    cursor: pointer;
    transition: var(--asp-transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 130px; /* Augmenté */
}
.asp-btn-primary {
    background: var(--asp-primary-color);
    color: white;
}
.asp-btn-primary:hover {
    background: color-mix(in srgb, var(--asp-primary-color) 85%, black);
    transform: translateY(-1px);
}
.asp-btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e5e5e5;
}
.asp-btn-secondary:hover {
    background: #e9ecef;
    border-color: #ccc;
}

/* Government aids content */
.asp-aids-content {
    font-family: var(--asp-font-family);
}
.asp-aids-section {
    margin-bottom: 30px; /* Augmenté */
    padding-bottom: 25px; /* Augmenté */
    border-bottom: 1px solid #f0f0f0;
}
.asp-aids-section:last-of-type {
    border-bottom: none;
}
.asp-aids-section h4 {
    color: var(--asp-primary-color);
    margin-bottom: 12px;
    font-size: 17px; /* Augmenté */
    font-weight: 600;
}
.asp-aids-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 14px; /* Augmenté */
}
.asp-aids-table th,
.asp-aids-table td {
    padding: 12px 14px; /* Augmenté */
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}
.asp-aids-table th {
    background: var(--asp-primary-color);
    color: white;
    font-weight: 600;
}
.asp-aids-table tr:last-child td {
    border-bottom: none;
}
.asp-rge-badge {
    background: linear-gradient(135deg, #e8f5e8, #d4f4d4);
    border: 2px solid var(--asp-primary-color);
    border-radius: 10px; /* Un peu plus rond */
    padding: 18px; /* Augmenté */
    margin: 25px 0; /* Augmenté */
    text-align: center;
}
.asp-rge-badge p {
    margin: 6px 0; /* Augmenté */
    color: var(--asp-primary-color);
}

/* Calculator results */
.asp-calculator-results {
    font-family: var(--asp-font-family);
}
.results-header h4 {
    color: var(--asp-primary-color);
    margin-bottom: 25px; /* Augmenté */
    font-size: 22px;
    text-align: center;
}
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Augmenté */
    gap: 20px; /* Augmenté */
    margin: 25px 0; /* Augmenté */
}
.result-card {
    background: #f8f9fa;
    padding: 25px 18px; /* Augmenté */
    border-radius: 12px; /* Un peu plus rond */
    text-align: center;
    border: 2px solid #e9ecef;
    transition: var(--asp-transition);
}
.result-card.highlight {
    background: linear-gradient(135deg, #e8f5e8, #d4f4d4);
    border-color: var(--asp-primary-color);
}
.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.result-value {
    font-size: 2em; /* Augmenté */
    font-weight: 700;
    color: var(--asp-primary-color);
    margin-bottom: 8px; /* Augmenté */
}
.result-label {
    font-size: 0.9em; /* Augmenté */
    color: #666;
    font-weight: 500;
}
.financial-breakdown {
    background: #f8f9fa;
    padding: 25px; /* Augmenté */
    border-radius: 10px; /* Un peu plus rond */
    margin: 25px 0; /* Augmenté */
}
.financial-breakdown h5 {
    margin-top: 0;
    margin-bottom: 18px; /* Augmenté */
    color: var(--asp-primary-color);
}
.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0; /* Augmenté */
    border-bottom: 1px solid #e9ecef;
}
.breakdown-item:last-child {
    border-bottom: none;
    font-weight: 600;
}
.breakdown-item.positive {
    color: var(--asp-primary-color);
}
.results-actions {
    margin: 30px 0; /* Augmenté */
    text-align: center;
}
.disclaimer {
    font-size: 13px; /* Augmenté */
    color: #666;
    font-style: italic;
    text-align: center;
    margin-top: 25px; /* Augmenté */
    padding-top: 20px; /* Augmenté */
    border-top: 1px solid #e9ecef;
}

/* Responsive design */
@media (max-width: 768px) {
    .asp-chatbot-container {
        width: calc(100vw - 30px);
        right: 15px;
        bottom: 80px;
    }
    .asp-chatbot-toggle {
        right: 15px;
        bottom: 15px;
        width: 55px;
        height: 55px;
        display: flex !important;
        visibility: visible !important;
    }
    .asp-modal {
        padding: 10px;
    }
    .asp-modal-content {
        padding: 20px;
    }
    .results-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }
    .result-value {
        font-size: 1.5em;
    }
    .asp-form-actions {
        flex-direction: column;
    }
    .asp-btn {
        width: 100%;
    }
}
@media (max-width: 480px) {
    .asp-chatbot-container {
        height: calc(100vh - 120px);
        bottom: 70px;
        width: calc(100vw - 20px);
        right: 10px;
    }
    .asp-chatbot-toggle {
        right: 10px;
        bottom: 10px;
        width: 52px;
        height: 52px;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    .asp-chatbot-header {
        padding: 15px;
    }
    .asp-company-name {
        font-size: 14px;
    }
    .asp-company-phone {
        font-size: 12px;
    }
    .asp-chatbot-messages {
        padding: 15px;
    }
    .asp-message-bubble {
        max-width: 90%;
        padding: 10px 14px;
    }
    .asp-chatbot-input-area,
    .asp-chatbot-footer {
        padding: 12px 15px;
    }
    .results-grid {
        grid-template-columns: 1fr;
    }
    .breakdown-item {
        flex-direction: column;
        gap: 5px;
        text-align: left;
    }
}

/* Print styles for results */
@media print {
    .asp-modal,
    .asp-chatbot-container,
    .asp-chatbot-toggle {
        display: none !important;
    }
}