/**
 * Core Vitals Widget Styles
 * 
 * @package CoreVitalsWidget
 * @author Metehan Turkdonmez
 * @company HELIAN.work
 * @website https://HELIAN.work
 * @version 1.0.0
 */

/* Core Vitals Widget Styles */
.cvw-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    padding: 12px;
}

.cvw-widget.cvw-visible {
    opacity: 1;
    transform: translateY(0);
}

.cvw-widget.cvw-minimized {
    display: none;
}

.cvw-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.cvw-widget-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #111827;
    margin: 0;
}

.cvw-widget-close {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    color: #6b7280;
    padding: 2px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.cvw-widget-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #374151;
}

.cvw-widget-content {
    display: flex;
    gap: 12px;
    transition: all 0.3s ease;
}

.cvw-widget.cvw-minimized .cvw-widget-content {
    display: none;
}

.cvw-widget.cvw-minimized .cvw-widget-header {
    display: none;
}

.cvw-widget-minimized-btn {
    position: fixed;
    bottom: 18px;
    left: 20px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s 
ease;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e3e3e3;
    padding: 15px 20px 15px 20px;
    border-radius: 40px;
    text-decoration: none;
    font-family: "Unbounded", ui-sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #19c559;
    box-shadow: 0 4px 18px -4px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    z-index: 9999;
}

.cvw-widget-minimized-btn.cvw-visible {
    opacity: 1;
    visibility: visible;
}

.cvw-widget-minimized-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.cvw-metric {
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.5);
    border-radius: 6px;
    padding: 8px 12px;
    min-width: 70px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    width: 100%;
}

.cvw-metric:hover {
    border-color: rgba(148, 163, 184, 0.4);
    background: rgba(241, 245, 249, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.cvw-metric:first-child {
    border-radius: 6px;
}

.cvw-metric:last-child {
    border-radius: 6px;
}

.cvw-metric:first-child:last-child {
    border-radius: 6px;
}

/* Hide loading metrics */
.cvw-metric.cvw-loading {
    display: none;
}

.cvw-metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.cvw-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    margin-bottom: 4px;
    transition: color 0.2s ease;
}

.cvw-value {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 2px;
    color: #374151;
    transition: color 0.2s ease;
}

.cvw-unit {
    font-size: 10px;
    color: #9ca3af;
    font-weight: 500;
    margin-bottom: 4px;
}

.cvw-status {
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    color: #6b7280;
    background: rgba(107, 114, 128, 0.1);
}

/* Color coding for performance levels */
/* Good performance - Green */
.cvw-metric.cvw-good .cvw-value {
    color: #059669;
}

.cvw-metric.cvw-good .cvw-label {
    color: #047857;
}

.cvw-metric.cvw-good .cvw-status {
    color: #065f46;
    background: rgba(16, 185, 129, 0.15);
}

.cvw-metric.cvw-good {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

/* Perfect performance (0 values) - Bright Green */
.cvw-metric.cvw-perfect .cvw-value {
    color: #10b981;
}

.cvw-metric.cvw-perfect .cvw-label {
    color: #059669;
}

.cvw-metric.cvw-perfect .cvw-status {
    color: #047857;
    background: rgba(16, 185, 129, 0.2);
}

.cvw-metric.cvw-perfect {
    border-color: #34d399;
    background: rgba(52, 211, 153, 0.08);
}

/* Needs Improvement - Yellow/Orange */
.cvw-metric.cvw-needs-improvement .cvw-value {
    color: #d97706;
}

.cvw-metric.cvw-needs-improvement .cvw-label {
    color: #b45309;
}

.cvw-metric.cvw-needs-improvement .cvw-status {
    color: #92400e;
    background: rgba(245, 158, 11, 0.15);
}

.cvw-metric.cvw-needs-improvement {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

/* Poor performance - Red */
.cvw-metric.cvw-poor .cvw-value {
    color: #dc2626;
}

.cvw-metric.cvw-poor .cvw-label {
    color: #b91c1c;
}

.cvw-metric.cvw-poor .cvw-status {
    color: #991b1b;
    background: rgba(239, 68, 68, 0.15);
}

    .cvw-metric.cvw-poor {
        border-color: #ef4444;
        background: rgba(239, 68, 68, 0.05);
    }

    /* Loading state */
    .cvw-metric.cvw-loading .cvw-value {
        color: #6b7280;
    }

    .cvw-metric.cvw-loading .cvw-status {
        color: #9ca3af;
        background: rgba(156, 163, 175, 0.1);
    }

    /* Modal Styles */
    .cvw-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 999999;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .cvw-modal.cvw-modal-visible {
        opacity: 1;
        visibility: visible;
    }

    .cvw-modal-content {
        background: white;
        border-radius: 12px;
        padding: 24px;
        max-width: 400px;
        width: 90%;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
        transform: scale(0.9) translateY(20px);
        transition: transform 0.3s ease;
        position: relative;
    }

    .cvw-modal-visible .cvw-modal-content {
        transform: scale(1) translateY(0);
    }

    .cvw-modal-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 16px;
        padding-bottom: 12px;
        border-bottom: 1px solid #e5e7eb;
    }

    .cvw-modal-title {
        font-size: 18px;
        font-weight: 600;
        color: #111827;
        margin: 0;
        line-height: 1.2;
    }

    .cvw-modal-close {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: #6b7280;
        padding: 0;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        transition: all 0.2s ease;
    }

    .cvw-modal-close:hover {
        background: #f3f4f6;
        color: #374151;
    }

    .cvw-modal-body {
        text-align: center;
    }

    .cvw-modal-metric {
        font-size: 48px;
        font-weight: 700;
        margin-bottom: 8px;
        transition: color 0.2s ease;
    }

    .cvw-modal-status {
        font-size: 16px;
        font-weight: 500;
        margin-bottom: 16px;
        padding: 8px 16px;
        border-radius: 8px;
        display: inline-block;
    }

    .cvw-modal-advice {
        font-size: 14px;
        color: #6b7280;
        line-height: 1.5;
        margin-bottom: 20px;
    }

    .cvw-modal-details {
        background: #f9fafb;
        border-radius: 8px;
        padding: 12px;
        font-size: 12px;
        color: #4b5563;
        text-align: left;
    }

    .cvw-modal-details strong {
        color: #111827;
    }

    /* Modal color variations */
    .cvw-modal-perfect .cvw-modal-metric {
        color: #10b981;
    }

    .cvw-modal-perfect .cvw-modal-status {
        color: #047857;
        background: rgba(16, 185, 129, 0.15);
    }

    .cvw-modal-good .cvw-modal-metric {
        color: #059669;
    }

    .cvw-modal-good .cvw-modal-status {
        color: #047857;
        background: rgba(16, 185, 129, 0.15);
    }

    .cvw-modal-fair .cvw-modal-metric {
        color: #d97706;
    }

    .cvw-modal-fair .cvw-modal-status {
        color: #92400e;
        background: rgba(245, 158, 11, 0.15);
    }

    .cvw-modal-poor .cvw-modal-metric {
        color: #dc2626;
    }

    .cvw-modal-poor .cvw-modal-status {
        color: #991b1b;
        background: rgba(239, 68, 68, 0.15);
    }/* Mobile responsive */
@media (max-width: 768px) {
	
    .cvw-widget {
		display:none;
        bottom: 15px;
        left: 15px;
        gap: 8px;
    }
    
    .cvw-metric {
        padding: 10px 12px;
        min-width: 70px;
    }
    
    .cvw-value {
        font-size: 16px;
    }
    
    .cvw-status {
        font-size: 8px;
        padding: 1px 4px;
    }
    
    .cvw-label {
        font-size: 10px;
    }
	
	.cvw-widget-minimized-btn{
				display:none;
	}
}
