/* Professional Energy Dashboard Styles for Soltolaria */

/* Dashboard Preview Container */
.energy-dashboard-preview {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.energy-dashboard-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--primary-color));
    animation: energyFlow 3s linear infinite;
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.dashboard-header h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-header h3 i {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4caf50;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

/* Dashboard Cards */
.dashboard-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dashboard-card:hover::before {
    opacity: 1;
}

.dashboard-card h4 {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Price Ticker Card */
.price-ticker-card {
    grid-column: span 2;
}

.price-display {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 15px;
}

.price-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Space Grotesk', monospace;
}

.price-change {
    font-size: 1rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: monospace;
}

.price-change.positive {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.price-change.negative {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

#price-chart {
    height: 60px;
    margin-top: 10px;
}

/* Demand Forecast Card */
.demand-card {
    grid-column: span 1;
}

#demand-chart {
    height: 80px;
    margin: 10px 0;
}

.forecast-summary {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    margin-top: 10px;
}

.forecast-summary strong {
    color: var(--primary-color);
}

/* Grid Efficiency Card */
.efficiency-card {
    text-align: center;
}

.efficiency-meter {
    position: relative;
    margin: 20px 0;
}

.meter-circle {
    position: relative;
    display: inline-block;
}

.meter-svg {
    transform: rotate(-90deg);
}

.meter-background {
    fill: none;
    stroke: rgba(255,255,255,0.1);
    stroke-width: 8;
}

.meter-progress {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}

.meter-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
}

.efficiency-status {
    margin-top: 10px;
}

.status-good {
    color: #4caf50;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Renewable Energy Card */
.renewable-card {
    text-align: center;
}

#renewable-chart {
    margin: 15px 0;
    display: flex;
    justify-content: center;
}

.renewable-summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.source-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.8);
}

.source-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.source-color.solar { background: #ff9500; }
.source-color.wind { background: #00c4cc; }
.source-color.hydro { background: #0080ff; }

/* AI Predictions Card */
.predictions-card {
    grid-column: span 2;
}

.predictions-card h4 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.predictions-card h4 i {
    color: var(--secondary-color);
}

.prediction-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prediction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.prediction-item:last-child {
    border-bottom: none;
}

.prediction-label {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

.prediction-value {
    color: white;
    font-weight: 600;
    font-family: monospace;
}

.prediction-value.low {
    color: #4caf50;
}

.prediction-value small {
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
}

/* Trading Activity Card */
.trading-card {
    grid-column: span 1;
}

.trading-feed {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trade-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    font-size: 0.85rem;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.trade-item.new-trade {
    background: rgba(243, 156, 18, 0.1);
    padding: 8px 10px;
    border-radius: 6px;
    animation: newTradeGlow 2s ease;
}

@keyframes newTradeGlow {
    0% { background: rgba(243, 156, 18, 0.3); }
    100% { background: rgba(243, 156, 18, 0.1); }
}

.trade-type {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.trade-type.buy {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.trade-type.sell {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.trade-amount {
    color: rgba(255,255,255,0.8);
    font-family: monospace;
}

.trade-price {
    color: white;
    font-weight: 600;
    font-family: monospace;
}

/* Dashboard CTA */
.dashboard-cta {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.dashboard-cta .btn {
    padding: 12px 24px;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.dashboard-cta .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* Demo Modal */
.demo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.demo-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.demo-modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
}

.demo-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.demo-modal-header h3 {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.demo-modal-header h3 i {
    color: var(--primary-color);
}

.demo-modal-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.demo-modal-close:hover {
    color: white;
}

.demo-modal-body {
    padding: 30px;
}

.demo-message {
    text-align: center;
    color: white;
}

.demo-message i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.demo-message h4 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.demo-message p {
    color: rgba(255,255,255,0.8);
    line-height: 1.6;
    margin-bottom: 25px;
}

.demo-features {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
    text-align: left;
}

.demo-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.9);
}

.demo-feature i {
    font-size: 1.2rem;
    color: var(--primary-color);
    width: 20px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .price-ticker-card,
    .predictions-card {
        grid-column: span 2;
    }
    
    .demand-card,
    .efficiency-card,
    .renewable-card,
    .trading-card {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .energy-dashboard-preview {
        padding: 20px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .price-ticker-card,
    .predictions-card,
    .demand-card,
    .efficiency-card,
    .renewable-card,
    .trading-card {
        grid-column: span 1;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .dashboard-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .dashboard-cta .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .demo-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .demo-modal-header,
    .demo-modal-body {
        padding: 20px;
    }
    
    .demo-features {
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .price-value {
        font-size: 2rem;
    }
    
    .prediction-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .renewable-summary {
        align-items: center;
    }
}