/**
 * Pörssisähkön Hinta - Styles
 * Optimized for all devices: Desktop, Tablet, Mobile
 */

/* Touch-friendly interactions */
.porssisahko-touch .porssisahko-tab-btn,
.porssisahko-touch .porssisahko-price-badge,
.porssisahko-touch button {
    min-height: 44px; /* iOS minimum tap target */
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
}

/* Mobile-specific optimizations */
.porssisahko-mobile .porssisahko-container {
    padding: 0 1rem;
}

/* Tablet-specific optimizations */
.porssisahko-tablet .porssisahko-tabs {
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Container */
.porssisahko-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Hero Section */
.porssisahko-hero {
    background: linear-gradient(135deg, #09BA65 0%, #52d093 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
}

.porssisahko-hero h1 {
    font-size: 2.5rem !important;
    font-weight: 700 !important;
    margin-bottom: 1rem !important;
    text-align: center !important;
    line-height: 1.2 !important;
    color: white !important;
}

.porssisahko-subtitle {
    text-align: left !important;
    font-size: 1.1rem !important;
    opacity: 0.95 !important;
    margin-bottom: 2rem !important;
    color: white !important;
}

/* Current Price Card */
.porssisahko-current-price-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.porssisahko-price-info {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
}

.porssisahko-label {
    display: block;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.porssisahko-price-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.porssisahko-price-value #porssisahko-current-price {
    font-size: 3.5rem;
    font-weight: 700;
    color: #09BA65;
}

.porssisahko-price-value .porssisahko-unit {
    font-size: 1.2rem;
    color: #64748b;
    font-weight: 500;
}

.porssisahko-time {
    display: block;
    color: #64748b;
    font-size: 0.9rem;
}

/* Live Indicator */
.porssisahko-live-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
}

.porssisahko-pulse {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: porssisahko-pulse 2s infinite;
}

@keyframes porssisahko-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.porssisahko-live-text {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

/* Price Statistics */
.porssisahko-price-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.porssisahko-stat {
    text-align: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
}

.porssisahko-stat-label {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.porssisahko-stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 600;
    color: #1e293b;
}

.porssisahko-stat-value.low {
    color: #10b981;
}

.porssisahko-stat-value.high {
    color: #ef4444;
}

/* Update Notice */
.porssisahko-update-notice {
    text-align: center !important;
    margin-top: 1.5rem !important;
    padding: 1.25rem !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 12px !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
}

.porssisahko-update-notice span {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

.porssisahko-update-notice span strong {
    color: #ffffff !important;
}

/* Tabs */
.porssisahko-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.porssisahko-tab-btn {
    padding: 1.25rem 1.75rem !important;
    background: #f8fafc !important;
    border: 2px solid #cbd5e1 !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    min-width: 200px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

.porssisahko-tab-btn span {
    display: block !important;
    font-size: 1.1rem !important;
    color: #0f172a !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
}

.porssisahko-tab-btn small {
    display: block !important;
    font-size: 0.9rem !important;
    color: #334155 !important;
    margin-top: 6px !important;
    font-weight: 600 !important;
}

.porssisahko-tab-btn:hover {
    border-color: #52d093 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1) !important;
}

.porssisahko-tab-btn.active {
    background: #52d093 !important;
    color: white !important;
    border-color: #52d093 !important;
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.4) !important;
}

.porssisahko-tab-btn.active span {
    color: white !important;
}

.porssisahko-tab-btn.active small {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 600 !important;
}

/* Chart Container */
.porssisahko-chart-container {
    background: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    margin-bottom: 2rem;
}

#porssisahko-price-chart {
    max-height: 400px;
}

/* Tab Content */
.porssisahko-tab-content {
    display: none;
}

.porssisahko-tab-content.active {
    display: block;
    animation: porssisahko-fade-in 0.3s ease;
}

@keyframes porssisahko-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Table */
.porssisahko-table-header {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    border-left: 4px solid #09BA65;
}

.porssisahko-table-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: #1e293b;
    font-weight: 700;
    line-height: 1.4;
}

.porssisahko-table-info {
    color: #475569;
    font-size: 1rem;
    font-weight: 500;
}

.porssisahko-table-wrapper {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    overflow: hidden;
}

.porssisahko-price-table {
    width: 100%;
    border-collapse: collapse;
}

.porssisahko-price-table thead {
    background: #09BA65;
    color: white;
}

.porssisahko-price-table th {
    padding: 1.5rem;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.porssisahko-price-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s ease;
}

.porssisahko-price-table tbody tr:hover {
    background: #f8fafc;
}

.porssisahko-price-table tbody tr.porssisahko-current-row {
    background: rgba(37, 99, 235, 0.1);
    font-weight: 600;
}

.porssisahko-price-table td {
    padding: 1.5rem;
}

/* Price Badges */
.porssisahko-price-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.porssisahko-price-badge.low {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.porssisahko-price-badge.medium {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.porssisahko-price-badge.high {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.porssisahko-price-badge.current {
    background: #09BA65;
    color: white;
}

/* Loading State */
.loading {
    display: inline-block;
    animation: porssisahko-loading-pulse 1.5s ease-in-out infinite;
}

@keyframes porssisahko-loading-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .porssisahko-hero h1 {
        font-size: 1.75rem;
    }

    .porssisahko-subtitle {
        font-size: 0.95rem;
    }

    .porssisahko-price-value #porssisahko-current-price {
        font-size: 2.5rem;
    }

    .porssisahko-tabs {
        flex-direction: column;
    }

    .porssisahko-tab-btn {
        width: 100%;
        padding: 1rem 1.5rem;
    }
    
    .porssisahko-tab-btn span {
        font-size: 1rem;
    }
    
    .porssisahko-tab-btn small {
        font-size: 0.85rem;
    }

    .porssisahko-price-stats {
        grid-template-columns: 1fr;
    }

    .porssisahko-price-table {
        font-size: 0.9rem;
    }

    .porssisahko-price-table th,
    .porssisahko-price-table td {
        padding: 1rem;
    }
    
    .porssisahko-table-header h2 {
        font-size: 1.25rem;
    }
    
    .porssisahko-table-info {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .porssisahko-hero h1 {
        font-size: 1.5rem;
    }

    .porssisahko-current-price-card {
        padding: 1.5rem;
    }

    .porssisahko-price-value #porssisahko-current-price {
        font-size: 2rem;
    }
    
    .porssisahko-tab-btn span {
        font-size: 0.95rem;
    }
    
    .porssisahko-tab-btn small {
        font-size: 0.8rem;
    }
    
    .porssisahko-table-header h2 {
        font-size: 1.1rem;
    }
    
    .porssisahko-table-info {
        font-size: 0.85rem;
    }
}
