/* Elprisprognos Plugin Styles */

/* =========================
   Graf Widget
   ========================= */

.elpris-chart-widget {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

/* Controls container */
.elpris-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    position: relative;
    z-index: 30; /* Högre än login-prompt (z-index 20) */
}

/* Region and period selectors */
.elpris-region-selector,
.elpris-period-selector {
    flex: 1;
    min-width: 200px;
    position: relative;
    z-index: 30; /* Säkerställ att de är ovanför allt */
}

.selector-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
    display: block;
}

.region-select,
.period-select {
    width: 100%;
    padding: 12px 40px 12px 16px;
    font-size: 15px;
    font-weight: 500;
    color: #1f2937;
    background-color: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    appearance: none;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.region-select:hover,
.period-select:hover {
    border-color: #d1d5db;
}

.region-select:focus,
.period-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Chart container */
.elpris-chart-container {
    position: relative;
    min-height: 450px;
    margin-bottom: 16px;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e5e7eb;
}

/* Blur chart when locked */
.elpris-chart-container.locked canvas {
    filter: blur(8px);
    opacity: 0.4;
    pointer-events: none;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    margin-top: 12px;
    color: #6b7280;
    font-size: 14px;
}

/* Login prompt */
.elpris-login-prompt {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 20;
    pointer-events: none; /* Låter inte promten blockera allt */
}

.elpris-login-prompt.active {
    pointer-events: none; /* Fortfarande ingen block på allt */
}

.login-prompt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    pointer-events: none; /* Overlay blockerar inte heller */
}

.login-prompt-content {
    position: relative;
    text-align: center;
    padding: 40px;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 1;
    pointer-events: all; /* Bara själva content-boxen ska vara klickbar */
}

.lock-icon-large {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

.login-prompt-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.login-prompt-content p {
    color: #666;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.login-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-block;
    font-size: 14px;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    border: 2px solid #3b82f6;
}

.btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: #3b82f6;
    border: 2px solid #3b82f6;
}

.btn-secondary:hover {
    background: #eff6ff;
    transform: translateY(-1px);
}

/* =========================
   Träffsäkerhets Widget
   ========================= */

.elpris-accuracy-widget {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0;
}

.accuracy-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 20px 0;
}

.accuracy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.accuracy-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
}

.accuracy-card:hover {
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.accuracy-card.locked {
    opacity: 0.65;
    background: #f9fafb;
}

.accuracy-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.ai-icon {
    color: #8b5cf6;
    font-size: 14px;
}

.period-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.period-badge.free {
    background: #d1fae5;
    color: #065f46;
}

.period-name {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.lock-icon {
    font-size: 14px;
}

.accuracy-value {
    font-size: 32px;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 4px;
}

.accuracy-note {
    font-size: 13px;
    color: #6b7280;
}

.accuracy-disclaimer {
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
    margin: 16px 0 0 0;
    line-height: 1.5;
}

/* =========================
   Info Widget
   ========================= */

.elpris-info-widget {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0;
}

.info-section {
    margin-bottom: 32px;
}

.info-section:last-of-type {
    margin-bottom: 24px;
}

.info-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 16px 0;
}

.info-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.info-list li {
    margin-bottom: 12px;
    padding-left: 24px;
    position: relative;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.6;
}

.info-list li::before {
    content: '•';
    position: absolute;
    left: 8px;
    color: #3b82f6;
    font-weight: bold;
    font-size: 18px;
}

.info-list strong {
    color: #1f2937;
    font-weight: 600;
}

.info-disclaimer {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 16px;
    border-radius: 8px;
    font-size: 13px;
    color: #92400e;
    line-height: 1.6;
}

.info-disclaimer strong {
    font-weight: 700;
    color: #78350f;
}

/* =========================
   Responsive Design
   ========================= */

@media (max-width: 768px) {
    .elpris-chart-widget,
    .elpris-accuracy-widget,
    .elpris-info-widget {
        padding: 0 16px;
    }
    
    .elpris-controls {
        flex-direction: column;
    }
    
    .elpris-region-selector,
    .elpris-period-selector {
        min-width: 100%;
    }
    
    .elpris-chart-container {
        min-height: 350px;
        padding: 16px;
    }
    
    .accuracy-grid {
        grid-template-columns: 1fr;
    }
    
    .login-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .accuracy-title,
    .info-section h3 {
        font-size: 16px;
    }
    
    .accuracy-value {
        font-size: 28px;
    }
    
    .elpris-chart-container {
        padding: 12px;
    }
    
    .selector-label {
        font-size: 13px;
    }
    
    .region-select,
    .period-select {
        font-size: 14px;
        padding: 10px 36px 10px 14px;
    }
}

