/* Floating Icon Container */
#prd-chat {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #714B67 0%, #0000FF 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(113, 75, 103, 0.4);
    z-index: 9999;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: prd-pulse 2s infinite;
}

#prd-chat:hover {
    transform: scale(1.1);
}

#prd-success-msg {
    position: fixed;
    bottom: 120px; /* Aligns slightly higher than the chat icon */
    right: 24px;
    width: 320px;
    background: #1a1a1a;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    z-index: 10001;
    border-left: 4px solid #714B67; /* Odoo Purple accent line */
    display: none;
}

#prd-success-popup {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 350px;
    background: #1a1a1a;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    z-index: 10001;
    border: 1px solid #714B67; /* Odoo Purple border for success */
    display: none;
}

/* Subtle Pulse Animation */
@keyframes prd-pulse {
    0% { box-shadow: 0 0 0 0 rgba(113, 75, 103, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(113, 75, 103, 0); }
    100% { box-shadow: 0 0 0 0 rgba(113, 75, 103, 0); }
}

/* The Popup Panel (Light Theme) */
.prd-popup-light {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    max-height: 80vh;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f4fd 100%);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(67, 56, 202, 0.15);
    overflow-y: hidden;
    display: none;
    z-index: 10000;
    border: 1px solid #e0e7ff;
    font-family: 'Inter', -apple-system, sans-serif;
}

/* The Popup Panel (Dark Theme) */
.prd-popup-dark {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    max-height: 80vh;
    background: #1a1a1a;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    overflow-y: auto;
    display: none;
    z-index: 10000;
    border: 1px solid #333;
    font-family: 'Inter', -apple-system, sans-serif;
}

/* Header Styling */
.prd-popup-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.prd-popup-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2d2d2d;
}

/* Form Styling */
.prd-form-step {
    padding: 24px;
}

.prd-input-group {
    margin-bottom: 16px;
}

.prd-input-group label {
    display: block;
    color: #999;
    font-size: 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.prd-input-group input, 
.prd-input-group textarea,
.prd-input-group select {
    width: 100%;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    outline: none;
    transition: border 0.3s;
    box-sizing: border-box;
}

.prd-input-group textarea {
    resize: none;
    overflow: hidden;
    min-height: 120px;
}

.prd-input-group input:focus {
    border-color: #714B67;
}

/* The Button Gradient */
.prd-generate-btn, .prd-download-btn, .prd-action-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, #714B67, #0000FF);
    color: white;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: opacity 0.3s;
}

.prd-generate-btn:hover, .prd-download-btn:hover, .prd-action-btn:hover {
    opacity: 0.9;
}

/* Loading Animations */
.prd-loading {
    text-align: center;
    padding: 30px 20px;
}

.prd-spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.prd-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #43C3FF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.prd-spinner-text {
    color: #666;
    font-size: 14px;
    font-weight: 500;
    margin-top: 10px;
}

.prd-preparing-doc {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
    animation-delay: 0.5s;
}

.doc-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(67, 195, 255, 0.1);
    border-radius: 6px;
    border-left: 3px solid #43C3FF;
    opacity: 0;
    animation: slideInLeft 0.5s ease-out forwards;
}

.doc-line:nth-child(1) { animation-delay: 1s; }
.doc-line:nth-child(2) { animation-delay: 1.5s; }
.doc-line:nth-child(3) { animation-delay: 2s; }
.doc-line:nth-child(4) { animation-delay: 2.5s; }

.doc-icon {
    font-size: 16px;
    min-width: 20px;
}

.doc-text {
    color: #666;
    font-size: 13px;
    font-weight: 500;
}

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #prd-chat {
        bottom: 16px;
        right: 16px;
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .prd-popup-light {
        bottom: 16px;
        right: 16px;
        left: 16px;
        width: calc(100% - 32px);
        max-width: 380px;
        max-height: 90vh;
    }
    
    .prd-popup-header {
        padding: 16px;
    }
    
    .prd-popup-header h3 {
        font-size: 16px;
    }
    
    .prd-form-step {
        padding: 20px;
    }
    
    .prd-input-group {
        margin-bottom: 14px;
    }
    
    .prd-input-group label {
        font-size: 11px;
        margin-bottom: 6px;
    }
    
    .prd-input-group input, 
    .prd-input-group textarea,
    .prd-input-group select {
        padding: 10px;
        font-size: 14px;
        box-sizing: border-box;
    }
    
    .prd-input-group textarea {
        resize: none;
        overflow: hidden;
        min-height: 100px;
    }
    
    .prd-phone-group select {
        width: 70px;
        padding: 10px;
    }
    
    .prd-phone-group input {
        width: calc(100% - 80px);
        padding: 10px;
    }
    
    .prd-generate-btn, .prd-download-btn, .prd-action-btn {
        padding: 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .prd-popup-light {
        bottom: 12px;
        right: 12px;
        left: 12px;
        width: calc(100% - 24px);
        max-height: 85vh;
    }
    
    .prd-popup-header {
        padding: 12px;
    }
    
    .prd-popup-header h3 {
        font-size: 14px;
    }
    
    .prd-form-step {
        padding: 16px;
    }
    
    .prd-input-group {
        margin-bottom: 12px;
    }
    
    .prd-input-group label {
        font-size: 10px;
        margin-bottom: 5px;
    }
    
    .prd-input-group input, 
    .prd-input-group textarea,
    .prd-input-group select {
        padding: 8px;
        font-size: 13px;
    }
    
    .prd-generate-btn, .prd-download-btn, .prd-action-btn {
        padding: 10px;
        font-size: 13px;
    }
}
