/* COALA Demo Creator Styles */

/* Demo Button Container */
.coala-demo-button-container {
    text-align: center;
    margin: 20px 0;
}

/* Demo Trigger Button */
.coala-demo-trigger-btn {
    padding: 16px 32px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.coala-demo-trigger-btn:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.coala-demo-trigger-btn:active {
    transform: translateY(0);
}

/* Button Variations */
.coala-btn-primary {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.coala-btn-primary:hover {
    background: linear-gradient(135deg, #27ae60, #229954);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.coala-btn-secondary {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
}

.coala-btn-secondary:hover {
    background: linear-gradient(135deg, #8e44ad, #7d3c98);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.4);
}

/* Modal Styles */
.coala-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.coala-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.coala-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.coala-modal-header {
    padding: 25px 30px 20px;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.coala-modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
}

.coala-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #95a5a6;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.coala-modal-close:hover {
    background: #ecf0f1;
    color: #2c3e50;
}

.coala-modal-body {
    padding: 30px;
}

.coala-demo-description {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 25px 0;
}

.coala-demo-form {
    margin-bottom: 20px;
}

.coala-form-group {
    margin-bottom: 20px;
}

.coala-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.coala-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.coala-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.coala-input:invalid {
    border-color: #e74c3c;
}

.coala-form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
}

.coala-cancel-btn {
    padding: 12px 24px;
    background: #ecf0f1;
    color: #2c3e50;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.coala-cancel-btn:hover {
    background: #d5dbdb;
}

.coala-submit-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 120px;
}

.coala-submit-btn:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
}

.coala-submit-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.btn-text, .btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.coala-message {
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: center;
    animation: slideIn 0.5s ease-out;
}

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

.coala-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.coala-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.success-icon, .error-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.coala-message h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.coala-message p {
    margin: 10px 0;
    line-height: 1.5;
}

.demo-link-container {
    background: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
}

.demo-link {
    color: #2980b9;
    text-decoration: none;
    font-weight: 600;
    word-break: break-all;
    padding: 8px 12px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 4px;
    display: inline-block;
    margin-left: 10px;
    transition: background 0.3s ease;
}

.demo-link:hover {
    background: rgba(52, 152, 219, 0.2);
    text-decoration: none;
}

.demo-info {
    font-style: italic;
    color: #666;
    font-size: 14px;
}

.coala-close-success-btn, .coala-retry-btn {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.coala-close-success-btn:hover, .coala-retry-btn:hover {
    background: #2980b9;
}

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

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

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

.coala-success .success-icon {
    animation: bounce 0.8s ease-in-out;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .coala-modal {
        padding: 10px;
    }
    
    .coala-modal-content {
        max-height: 95vh;
    }
    
    .coala-modal-header {
        padding: 20px 20px 15px;
    }
    
    .coala-modal-header h3 {
        font-size: 20px;
    }
    
    .coala-modal-body {
        padding: 20px;
    }
    
    .coala-form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .coala-cancel-btn, .coala-submit-btn {
        width: 100%;
    }
    
    .coala-demo-trigger-btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Loading Animation */
.coala-loading .coala-input {
    background: #f8f9fa;
}

.coala-loading .coala-demo-form {
    opacity: 0.4;
    pointer-events: none;
}

/* Progress Container */
.coala-progress-container {
    display: none;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: 12px;
    margin-top: 20px;
    border: 1px solid #e1e8ed;
    animation: slideIn 0.4s ease-out;
}

.coala-progress-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.coala-progress-icon {
    font-size: 32px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.coala-progress-title {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

/* Progress Bar */
.coala-progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.coala-progress-bar {
    flex: 1;
    height: 12px;
    background: #e1e8ed;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.coala-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 6px;
    transition: width 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.coala-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.coala-progress-percent {
    font-weight: 700;
    color: #3498db;
    font-size: 14px;
    min-width: 40px;
}

/* Progress Steps */
.coala-progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0 10px;
}

.coala-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.coala-progress-step.active {
    opacity: 1;
}

.coala-progress-step.completed .step-icon {
    background: #2ecc71;
}

.coala-progress-step .step-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #bdc3c7;
    border-radius: 50%;
    font-size: 16px;
    transition: all 0.3s ease;
}

.coala-progress-step.active .step-icon {
    background: #3498db;
    animation: stepPulse 1s ease-in-out infinite;
}

@keyframes stepPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(52, 152, 219, 0); }
}

.coala-progress-step span {
    font-size: 11px;
    color: #666;
    text-align: center;
    font-weight: 500;
}

.coala-progress-step.active span {
    color: #3498db;
}

.coala-progress-step.completed span {
    color: #2ecc71;
}

/* Progress Message */
.coala-progress-message {
    text-align: center;
    color: #555;
    font-size: 14px;
    margin: 0;
    font-style: italic;
}

/* Mobile adjustments for progress */
@media (max-width: 768px) {
    .coala-progress-steps {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }
    
    .coala-progress-step {
        flex: 0 0 auto;
    }
    
    .coala-progress-step span {
        font-size: 10px;
    }
}
