/* ================================================
   SDG WIDGET - STYLES
   Widget flottant élégant et non-intrusif
   ================================================ */

.sdg-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Open Sans', sans-serif;
}

/* Bouton Toggle */
.sdg-widget-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #004d40, #00796b);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(0, 77, 64, 0.4);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.sdg-widget-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 77, 64, 0.5);
    animation: none;
}

.widget-icon {
    font-size: 20px;
    animation: rotate 3s linear infinite;
}

.widget-text {
    white-space: nowrap;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(0, 77, 64, 0.4);
    }
    50% {
        box-shadow: 0 6px 30px rgba(0, 191, 165, 0.6);
    }
}

@keyframes rotate {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    75% {
        transform: rotate(10deg);
    }
}

/* Panel */
.sdg-widget-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    max-height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.sdg-widget-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Panel Header */
.widget-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #004d40, #00796b);
    border-radius: 20px 20px 0 0;
    color: white;
}

.widget-panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.widget-close {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.3s ease;
}

.widget-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Panel Content */
.widget-panel-content {
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.widget-panel-content::-webkit-scrollbar {
    width: 6px;
}

.widget-panel-content::-webkit-scrollbar-thumb {
    background: #00796b;
    border-radius: 3px;
}

/* Tabs */
.widget-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.widget-tabs::-webkit-scrollbar {
    height: 3px;
}

.widget-tab {
    flex-shrink: 0;
    padding: 8px 12px;
    background: #f5f5f5;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #546e7a;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.widget-tab:hover {
    background: #e0f2f1;
    color: #004d40;
}

.widget-tab.active {
    background: linear-gradient(135deg, #004d40, #00796b);
    color: white;
}

/* Tab Content */
.widget-tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.widget-tab-content.active {
    display: block;
}

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

.widget-tab-content h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #004d40;
}

.widget-source {
    font-size: 11px;
    color: #78909c;
    margin-bottom: 15px;
}

/* Progress Items */
.widget-progress-item {
    margin-bottom: 15px;
}

.widget-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #37474f;
}

.widget-progress-bar {
    height: 8px;
    background: #eceff1;
    border-radius: 10px;
    overflow: hidden;
}

.widget-progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease;
}

.widget-progress-fill.success {
    background: linear-gradient(90deg, #4caf50, #66bb6a);
}

.widget-progress-fill.warning {
    background: linear-gradient(90deg, #ff9800, #ffb74d);
}

.widget-progress-fill.danger {
    background: linear-gradient(90deg, #f44336, #ef5350);
}

/* Stat Grid */
.widget-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

.widget-stat-box {
    background: linear-gradient(135deg, #e0f2f1, #b2dfdb);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #00796b;
    transition: all 0.3s ease;
}

.widget-stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 121, 107, 0.2);
}

.widget-stat-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.widget-stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #004d40;
    margin-bottom: 4px;
}

.widget-stat-label {
    font-size: 11px;
    color: #546e7a;
    font-weight: 600;
}

/* Climate Alert */
.widget-climate-alert {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    padding: 15px;
    border-radius: 12px;
    border: 2px solid #f44336;
    margin-bottom: 15px;
}

.widget-alert-icon {
    font-size: 36px;
}

.widget-alert-value {
    font-size: 28px;
    font-weight: bold;
    color: #c62828;
}

.widget-alert-label {
    font-size: 11px;
    color: #d32f2f;
    font-weight: 600;
}

/* Stat List */
.widget-stat-list {
    margin-bottom: 15px;
}

.widget-stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.widget-stat-item:hover {
    background: #e0f2f1;
    transform: translateX(5px);
}

.widget-stat-item.alert {
    background: #fff3e0;
    border-left: 3px solid #ff9800;
}

.widget-stat-icon-small {
    font-size: 18px;
}

.widget-stat-text {
    font-size: 13px;
    color: #37474f;
}

.widget-stat-text strong {
    color: #004d40;
    font-weight: 700;
}

/* CTA Button */
.widget-cta {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.widget-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #004d40, #00796b);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.widget-btn:hover {
    background: linear-gradient(135deg, #00796b, #004d40);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 77, 64, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .sdg-widget {
        bottom: 20px;
        right: 20px;
    }
    
    .sdg-widget-toggle {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .widget-text {
        display: none;
    }
    
    .widget-icon {
        font-size: 24px;
    }
    
    .sdg-widget-panel {
        width: calc(100vw - 40px);
        max-width: 350px;
    }
    
    .widget-tabs {
        gap: 3px;
    }
    
    .widget-tab {
        padding: 6px 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .sdg-widget-panel {
        bottom: 70px;
        right: -10px;
        max-height: calc(100vh - 150px);
    }
    
    .widget-stat-grid {
        grid-template-columns: 1fr;
    }
}

/* Print: Hide widget */
@media print {
    .sdg-widget {
        display: none !important;
    }
}
