/* OpenCactus Bioeconomy Modal System CSS v1.0.2 */

/* Container del modal */
.opencactus-gamma-container {
    position: relative;
    display: inline-block;
}

/* Pulsante trigger */
.opencactus-gamma-trigger {
    background: #2D5016 !important;
    color: white !important;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.opencactus-gamma-trigger:hover {
    background: #4A7C59 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Modal backdrop */
.bioeconomy-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: none;
}

.bioeconomy-modal-backdrop.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal container */
.bioeconomy-modal {
    position: relative;
    background: white;
    border-radius: 8px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* Modal header */
.bioeconomy-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2D5016;
    color: white;
}

.bioeconomy-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.bioeconomy-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.bioeconomy-modal-close:hover {
    background: rgba(255,255,255,0.2);
}

/* Modal body */
.bioeconomy-modal-body {
    padding: 0;
    position: relative;
}

.bioeconomy-modal-iframe {
    width: 100%;
    height: 600px;
    border: none;
    display: block;
}

/* Fallback messages */
.bioeconomy-fallback-message {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

.bioeconomy-fallback-message h3 {
    color: #2D5016;
    margin-bottom: 20px;
}

.bioeconomy-fallback-buttons {
    margin-top: 20px;
}

.bioeconomy-fallback-btn {
    background: #E85D04;
    color: white;
    border: none;
    padding: 12px 24px;
    margin: 0 10px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    transition: all 0.3s ease;
}

.bioeconomy-fallback-btn:hover {
    background: #d14d00;
    transform: translateY(-1px);
}

/* Loading state */
.bioeconomy-modal-loading {
    padding: 60px 20px;
    text-align: center;
    color: #666;
}

.bioeconomy-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2D5016;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .bioeconomy-modal {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .bioeconomy-modal-iframe {
        height: 400px;
    }
    
    .opencactus-gamma-trigger {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Debug mode styles */
.bioeconomy-debug-info {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 12px;
    z-index: 10000;
    max-width: 300px;
}

/* Animazioni */
.bioeconomy-modal-backdrop.active {
    animation: fadeIn 0.3s ease;
}

.bioeconomy-modal {
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: scale(0.9) translateY(-20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}