/* 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); }
}

/* Enhanced Loading Animation Styles */
.coala-loading-container {
    text-align: center;
    padding: 30px 20px;
    animation: slideIn 0.5s ease-out;
}

.coala-loading-header {
    margin-bottom: 30px;
}

.coala-loading-icon {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.coala-gear {
    position: absolute;
    border: 4px solid #3498db;
    border-radius: 50%;
    animation: gearRotate 3s linear infinite;
}

.coala-gear:first-child {
    width: 80px;
    height: 80px;
    top: 0;
    left: 0;
    border-top-color: transparent;
    border-right-color: transparent;
}

.coala-gear-small {
    width: 40px;
    height: 40px;
    top: 20px;
    left: 20px;
    border-color: #e74c3c;
    border-bottom-color: transparent;
    border-left-color: transparent;
    animation: gearRotate 2s linear infinite reverse;
}

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

.coala-loading-header h4 {
    color: #2c3e50;
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.coala-loading-subtitle {
    color: #7f8c8d;
    font-size: 14px;
    margin: 0;
}

.coala-progress-container {
    margin: 25px 0;
    position: relative;
}

.coala-progress-bar {
    width: 100%;
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

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

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

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

.coala-progress-text {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #3498db;
}

.coala-loading-steps {
    margin: 30px 0;
}

.coala-step {
    display: flex;
    align-items: center;
    padding: 10px 0;
    opacity: 0.4;
    transition: all 0.5s ease;
}

.coala-step.active {
    opacity: 1;
    transform: scale(1.02);
}

.coala-step.completed {
    opacity: 0.7;
    color: #27ae60;
}

.coala-step-icon {
    font-size: 20px;
    margin-right: 15px;
    min-width: 30px;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.coala-step.active .coala-step-icon,
.coala-step.completed .coala-step-icon {
    filter: grayscale(0%);
    animation: bounce 0.5s ease;
}

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

.coala-step-text {
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
    text-align: left;
}

.coala-loading-footer {
    margin-top: 25px;
    padding: 15px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.coala-loading-footer p {
    margin: 0;
    color: #2c3e50;
    font-size: 14px;
    font-style: italic;
}

/* Responsive Design for Loading Animation */
@media (max-width: 768px) {
    .coala-loading-container {
        padding: 20px 15px;
    }
    
    .coala-loading-icon {
        width: 60px;
        height: 60px;
    }
    
    .coala-gear:first-child {
        width: 60px;
        height: 60px;
    }
    
    .coala-gear-small {
        width: 30px;
        height: 30px;
        top: 15px;
        left: 15px;
    }
    
    .coala-loading-header h4 {
        font-size: 18px;
    }
    
    .coala-step {
        padding: 8px 0;
    }
    
    .coala-step-icon {
        font-size: 18px;
        margin-right: 12px;
        min-width: 25px;
    }
    
    .coala-step-text {
        font-size: 14px;
    }
}

/* Additional enhancements */
.coala-loading-container::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 2px;
    animation: loadingBar 2s ease-in-out infinite;
}

@keyframes loadingBar {
    0%, 100% { width: 20px; opacity: 0.5; }
    50% { width: 80px; opacity: 1; }
}

.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 {
    opacity: 0.7;
    pointer-events: none;
}

.coala-loading .coala-input {
    background: #f8f9fa;
}
