/**
 * Public CSS for Asera AI Plugin
 */

/* Container Styles */
.asera-ai-form-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Style Variations */
.asera-ai-style-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    color: white;
}

.asera-ai-style-modern .asera-ai-form-header,
.asera-ai-style-modern .asera-ai-label {
    color: white;
}

.asera-ai-style-modern .asera-ai-input,
.asera-ai-style-modern .asera-ai-textarea {
    background: rgba(255, 255, 255, 0.95);
}

.asera-ai-style-minimal {
    box-shadow: none;
    border: 2px solid #e0e0e0;
    background: #fafafa;
}

/* Form Header */
.asera-ai-form-header {
    text-align: center;
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 2px solid #f0f0f0;
}

.asera-ai-form-title {
    color: #2c3e50;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.2;
}

.asera-ai-form-description {
    color: #7f8c8d;
    font-size: 16px;
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto;
}

/* Form Groups */
.asera-ai-form-group {
    margin-bottom: 28px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Labels */
.asera-ai-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
    letter-spacing: 0.3px;
}

.asera-ai-label .required {
    color: #e74c3c;
    font-weight: 700;
    margin-left: 2px;
}

/* Input Fields */
.asera-ai-input,
.asera-ai-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fff;
    box-sizing: border-box;
}

.asera-ai-input:hover,
.asera-ai-textarea:hover {
    border-color: #bdc3c7;
}

.asera-ai-input:focus,
.asera-ai-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.asera-ai-input::placeholder,
.asera-ai-textarea::placeholder {
    color: #95a5a6;
    font-style: italic;
}

.asera-ai-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

/* Help Text */
.asera-ai-help-text {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #7f8c8d;
    font-style: italic;
    line-height: 1.4;
}

/* Form Actions */
.asera-ai-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 35px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

/* Buttons */
.asera-ai-button {
    padding: 14px 28px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.asera-ai-button:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.asera-ai-button:hover:before {
    width: 300px;
    height: 300px;
}

.asera-ai-button-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.asera-ai-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.asera-ai-button-secondary {
    background: #ecf0f1;
    color: #34495e;
}

.asera-ai-button-secondary:hover {
    background: #d5dbdd;
}

.asera-ai-button-success {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.asera-ai-button-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.asera-ai-button-info {
    background: linear-gradient(135deg, #8e44ad 0%, #71368a 100%);
    color: white;
}

.asera-ai-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.asera-ai-button .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.asera-ai-button.loading .spinner {
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Result Container */
.asera-ai-result-container {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.asera-ai-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
}

.asera-ai-result-header h3 {
    color: #27ae60;
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.asera-ai-result-actions {
    display: flex;
    gap: 12px;
}

/* Result Meta */
.asera-ai-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    font-size: 14px;
    color: #5d6d7e;
}

.asera-ai-result-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
}

.asera-ai-result-meta .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Result Content */
.asera-ai-result-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    min-height: 200px;
    max-height: 600px;
    overflow-y: auto;
    line-height: 1.8;
    font-size: 16px;
    color: #2c3e50;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.asera-ai-result-content h2 {
    color: #2c3e50;
    font-size: 24px;
    margin: 20px 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.asera-ai-result-content h3 {
    color: #34495e;
    font-size: 20px;
    margin: 18px 0 12px;
}

.asera-ai-result-content h4 {
    color: #34495e;
    font-size: 18px;
    margin: 15px 0 10px;
}

.asera-ai-result-content p {
    margin: 15px 0;
    text-align: justify;
}

/* Result Footer */
.asera-ai-result-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
}

.asera-ai-share-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.asera-ai-share-buttons span:first-child {
    font-weight: 600;
    color: #5d6d7e;
}

.asera-ai-share-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: white;
    color: #5d6d7e;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.asera-ai-share-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.asera-ai-share-btn[data-platform="facebook"]:hover {
    background: #1877f2;
    color: white;
}

.asera-ai-share-btn[data-platform="twitter"]:hover {
    background: #1da1f2;
    color: white;
}

.asera-ai-share-btn[data-platform="linkedin"]:hover {
    background: #0077b5;
    color: white;
}

.asera-ai-share-btn[data-platform="whatsapp"]:hover {
    background: #25d366;
    color: white;
}

/* Error Container */
.asera-ai-error-container {
    margin-top: 30px;
    padding: 25px;
    background: #fee;
    border: 2px solid #fcc;
    border-radius: 8px;
    text-align: center;
}

.asera-ai-error-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.asera-ai-error-content .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #e74c3c;
}

#asera-ai-error-message {
    color: #c0392b;
    font-size: 16px;
    margin: 0;
}

/* Loading Overlay */
.asera-ai-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(5px);
}

.asera-ai-loading-content {
    background: white;
    padding: 50px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.asera-ai-loader {
    width: 60px;
    height: 60px;
    border: 4px solid #ecf0f1;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

.asera-ai-loading-text {
    font-size: 18px;
    color: #2c3e50;
    margin: 0 0 10px;
    font-weight: 600;
}

.asera-ai-loading-subtext {
    font-size: 14px;
    color: #7f8c8d;
    margin: 0;
}

/* Toast Notification */
.asera-ai-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
    z-index: 100000;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.asera-ai-toast .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.toast-message {
    font-size: 15px;
    font-weight: 500;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .asera-ai-form-container {
        margin: 20px;
        padding: 20px;
    }
    
    .asera-ai-form-title {
        font-size: 24px;
    }
    
    .asera-ai-form-actions {
        flex-direction: column;
    }
    
    .asera-ai-button {
        width: 100%;
    }
    
    .asera-ai-result-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .asera-ai-result-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .asera-ai-result-meta {
        justify-content: center;
    }
    
    .asera-ai-share-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .asera-ai-toast {
        right: 20px;
        left: 20px;
        bottom: 20px;
    }
}

/* Print Styles */
@media print {
    .asera-ai-form-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .asera-ai-form,
    .asera-ai-result-actions,
    .asera-ai-result-footer,
    .asera-ai-button {
        display: none;
    }
    
    .asera-ai-result-content {
        max-height: none;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Accessibility */
.asera-ai-button:focus,
.asera-ai-input:focus,
.asera-ai-textarea:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .asera-ai-form-container {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .asera-ai-form-header {
        border-bottom-color: #34495e;
    }
    
    .asera-ai-form-title,
    .asera-ai-label {
        color: #ecf0f1;
    }
    
    .asera-ai-form-description,
    .asera-ai-help-text {
        color: #bdc3c7;
    }
    
    .asera-ai-input,
    .asera-ai-textarea {
        background: #34495e;
        color: #ecf0f1;
        border-color: #34495e;
    }
    
    .asera-ai-input:focus,
    .asera-ai-textarea:focus {
        border-color: #3498db;
        background: #2c3e50;
    }
}
