
/* ==================================================
   Z�KLAD
   ================================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    min-height: 100vh;
}

/* Spole�n� z�klad pro ob� vrstvy pozad� */
#bg-base, #bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* Spodn� vrstva (dr�� st�vaj�c� obr�zek nebo tmav� p�echod jako z�klad) */
/* Spodn� vrstva */
#bg-base {
    z-index: -1002;
    background-image: radial-gradient(
        circle at 50% 40%,
        #172033 0%,
        #0b101c 55%,
        #060912 100%
    );
}

/* Horn� vrstva (p�es ni se plynule prolne nov� obr�zek) */
#bg-overlay {
    z-index: -1001;
    opacity: 0; /* V�choz� stav je neviditeln� */
    /* Plynul� animace pr�hlednosti na 5 sekund */
    transition: opacity 5000ms ease-in-out; 
}



/* ==================================================
   HLAVN� KONTEJNER
   ================================================== */

.container {

    max-width: 1500px;
    hight: 850px;
    margin: auto;

    padding: 20px 25px 35px;
}


/* ==================================================
   HLAVI�KA
   ================================================== */

.header {

    text-align: center;

    margin-bottom: 10px;
}

.header h1 {

    margin: 0;

    font-size: 34px;

    letter-spacing: 1px;
}

.sun {

    color: #ffd21c;

    font-size: 35px;
}

.updated {
   
       position: relative;

    left: 22px;

    margin-top: 7px;

    color: #B0E0FF;

    font-size: 14px;
}

.cas {

color: #B0E0FF;

    font-size: 20px;

}

/* ==================================================
   INFORMACE + ODKAZY V HLAVIČCE
   ================================================== */

.header-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 12px;
    min-height: 66px;
}

.header .updated {
    flex: 0 0 290px;
    margin-top: 0;
    text-align: left;
    line-height: 1.5;
}

.header .cas {
    font-size: 15px;
    margin-top: 3px;
}

.page-links {
    position: relative;
    right: 45px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 145px;
    min-height: 46px;
    padding: 11px 18px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 9px;
    color: #f4f8ff;
    text-decoration: none;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .3px;
    background: linear-gradient(145deg, #26374c, #111c2b);
    box-shadow: 0 5px 14px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.12);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.page-link:hover {
    transform: translateY(-3px);
    filter: brightness(1.5);
    box-shadow: 0 8px 18px rgba(0,0,0,.32), 0 0 12px rgba(80,170,255,.15);
}

.page-link-blue {
    border-color: rgba(22, 142, 208, 0.7);
    background: linear-gradient(
        145deg,
        rgba(23, 105, 154, 0.65),
        rgba(16, 49, 77, 0.65)
    );
}

.page-link-gold {
    border-color: rgba(193, 140, 21, 0.7);
    background: linear-gradient(
        145deg,
        rgba(140, 100, 18, 0.65),
        rgba(61, 43, 11, 0.65)
    );
}

.page-link-green {
    border-color: rgba(54, 184, 74, 0.7);
    background: linear-gradient(
        145deg,
        rgba(33, 123, 53, 0.65),
        rgba(16, 53, 27, 0.65)
    );
}

.page-link-violet {
    border-color: rgba(150, 112, 232, 0.7);
    background: linear-gradient(
        145deg,
        rgba(101, 69, 165, 0.65),
        rgba(42, 29, 75, 0.65)
    );
}

.page-link-orange {
    border-color: rgba(225, 102, 51, 0.7);
    background: linear-gradient(
        145deg,
        rgba(210, 30, 20, 0.5),
        rgba(130, 15, 5, 0.5)
    );
}


@media (max-width: 900px) {
    .header-tools {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .header .updated {
        flex-basis: auto;
        text-align: center;
    }

    .page-links {
        justify-content: center;
        flex-wrap: wrap;
    }

    .page-link {
        min-width: 125px;
    }
}


/* ==================================================
   Hlavní schema
   ================================================== */

.energy-system {

    position: relative;

    height: 550px;
    min-height: 520px;

    margin-top: 5px;
    overflow: hidden;
}


/* ==================================================
   KABELY
   ================================================== */

.energy-svg {

    position: absolute;

    left: 0;
    top: 0;

    width: 100%;
    height: 520px;

    pointer-events: none;

    overflow: hidden;
    clip-path: inset(20px 0 0 20px);
}


/* základní kabel */

.cable {

    fill: none;

    stroke-width: 6;

    stroke-linecap: round;

    filter:
        drop-shadow(0 0 5px currentColor)
        drop-shadow(0 0 10px currentColor);
}


/* PV */

.cable-pv {

    stroke: #19a9ff;
}


/* AC */

.cable-ac {

    stroke: #ffbf1a;
}


/* baterie */

.cable-battery {

    stroke: #4cff55;
}


/* ==================================================
   ELEKTRONY
   ================================================== */

.electron-pv {

    fill: #7dd7ff;

    filter:
        drop-shadow(0 0 6px #19a9ff)
        drop-shadow(0 0 12px #19a9ff);
}

.electron-ac {

    fill: #fff2a0;

    filter:
        drop-shadow(0 0 6px #ffbf1a)
        drop-shadow(0 0 12px #ffbf1a);
}

.electron-battery {

    fill: #a4ff9d;

    filter:
        drop-shadow(0 0 6px #4cff55)
        drop-shadow(0 0 12px #4cff55);
}


/* ==================================================
    PANELY
   ================================================== */

.panel {




    position: absolute;

    left: 20px;

    width: 260px;
    
    padding: 18px 20px;
    
    background-image: url('../img/panel3.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

   /* background: linear-gradient(
        145deg,
        rgba(29, 41, 59, 0.75),
        rgba(17, 25, 39, 0.75)
    );*/
    
    text-align: center;
    border: 1px solid #168ed0;

    border-radius: 5px;

   /* box-shadow:
        0 0 15px rgba(0,160,255,.15),
        inset 0 0 20px rgba(0,100,200,.04);*/
}

.panel1 {
    top: 25px;
}

.panel2 {
    top: 205px;
}

.panel h2 {

    margin: 0 0 10px;

    color: #51c4ff;

    font-size: 21px;
}

.panel .power {

    font-size: 31px;

    font-weight: bold;

    color: #6bcaff;

    margin-bottom: 8px;
}

.details {

    color: #bdc8d8;

    line-height: 1.7;

    font-size: 15px;
}







/* ==================================================
   Měnič
   ================================================== */

.inverter {

    position: absolute;

    left: 50%;

    top: 25px;

    transform: translateX(-50%);

    width: 230px;

    height: 300px;

    border-radius: 5px;

    background:
        linear-gradient(
            145deg,
            #d8e1e7,
            #87949e 45%,
            #394550 100%
        );

    border: 2px solid #aebbc4;

    box-shadow:
        0 0 25px rgba(0,130,255,.25),
        inset 0 0 20px rgba(255,255,255,.15);

    color: #101820;

    text-align: center;

    z-index: 5;
}

.inverter-screen {

    width: 145px;

    height: 90px;

    margin: 35px auto 18px;

    background:
        linear-gradient(
            #0c4570,
            #061b2d
        );

    border: 4px solid #252f37;

    border-radius: 3px;

    box-shadow:
        inset 0 0 15px #008cff;

    color: #7ddcff;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 12px;
}

     .inverter-data {

    margin-top: 10px;

    text-align: center;
}

.inverter-data .inverter-power {

    font-size: 28px;

    font-weight: bold;

    color: #111820;
}

.inverter-load {

    margin-top: 7px;

    font-size: 17px;

    font-weight: bold;

    color: #202b34;
}

.inverter-details {

    margin-top: 10px;

    font-size: 15px;

    color: #26333d;
}


/* ==================================================
   BATERIE
   ================================================== */

.battery {

    position: absolute;

    right: 45px;

    //top: 330px;
     bottom: 35px;

    width: 280px;
    min-height: 180px;

    padding: 15px 20px;

    display: flex;
    align-items: center;

    box-sizing: border-box;

    border-radius: 5px;

    background: linear-gradient(
        145deg,
        rgba(29, 41, 59, 0.75),
        rgba(17, 25, 39, 0.75)
    );

    border: 1px solid #4cff55;

   // box-shadow:
   //     0 0 18px rgba(60,255,80,.12);
       box-shadow:
        0 0 25px rgba(0,130,255,.25),
        inset 0 0 20px rgba(255,255,255,.15);

    z-index: 5;
}

.battery-left {

    width: 60px;

    display: flex;

    justify-content: center;

    align-items: center;
}


.battery-data {

    flex: 1;

    text-align: center;

    margin-left: 0;
}

.battery-nadpis {
    
       font-size: 22px;
        color: #a9f5a9;
    font-weight: bold; 
}

.battery-voltage {

    font-size: 26px;

    font-weight: bold;
}


.battery-current {

    margin-top: 8px;

    font-size: 18px;

    font-weight: bold;
}

.battery-icon {

    position: relative;

    width: 60px;
    height: 130px;

    border: 3px solid #ddd;

    border-radius: 5px;

    box-sizing: border-box;

    overflow: hidden;

    background: #10151c;
}


.battery-icon::before {

    content: "";

    position: absolute;

    top: -7px;
    left: 12px;

    width: 18px;
    height: 5px;

    background: #ddd;

    border-radius: 2px;
}


.battery-level {

    position: absolute;

    left: 0;
    bottom: 0;

    width: 100%;

    height: 50%;

    background: #42e85a;

    transition: height 0.8s ease;
}


.battery-percent {

    position: absolute;

    left: 0;
    right: 0;

    top: 50%;

    transform: translateY(-50%);

    text-align: center;

    font-size: 20px;

    font-weight: bold;

    color: white;

    text-shadow:
        0 2px 4px black;
}

.battery-icon:before {

    content: "";

    position: absolute;

    top: -13px;

    left: 22px;

    width: 27px;

    height: 9px;

    background: #4cff55;

    border-radius: 3px 3px 0 0;
}

.battery h2 {

    margin: 8px 0 3px;

    color: #5cff63;
}

.battery-value {

    font-size: 27px;

    font-weight: bold;
}

.battery-current {

    color: #a9f5a9;

    margin-top: 5px;
}


/* ==================================================
   spotřeba dům
   ================================================== */

.house {

    position: absolute;

    right: 45px;

    top: 25px;

    width: 280px;
    height:  300px;
    padding: 20px;

    border-radius: 5px;
    
    background-image: url('../img/house.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

   /* background: linear-gradient(
        145deg,
        rgba(29, 41, 59, 0.75),
        rgba(17, 25, 39, 0.75)
    );*/

    border: 1px solid #c18c15;

    box-shadow:
        0 0 18px rgba(255,190,20,.12);

    z-index: 5;
}

.house-icon {

    font-size: 58px;

    text-align: center;

    margin-bottom: 5px;
}

.house h2 {

    text-align: center;

    margin: 0 0 10px;

    color: #ffc832;

    font-size: 22px;
}

.house .power {

    text-align: center;

    font-size: 32px;

    font-weight: bold;

    color: #ffd05b;

    margin-bottom: 10px;
}


/* ==================================================
   INFORMACE VEDLE VýSTUPU
   ================================================== */

.output-info {

    position: absolute;

    right: 305px;

    top: 120px;

    color: #ffd65b;

    text-shadow: 0 0 8px #ffae00;

    background: rgba(5,12,24,.75);

    padding: 7px 10px;

    border-radius: 5px;

    line-height: 1.5;

    font-size: 14px;
}


/* ==================================================
   FV CELKEM
   ================================================== */

.total {

    position: absolute;

    left: 25px;

    bottom: 35px;

    width: 260px; //260
    height: 100;
    padding: 16px;

    text-align: center;

    border-radius: 5px;

    background: linear-gradient(
        145deg,
        rgba(29, 41, 59, 0.75),
        rgba(17, 25, 39, 0.75)
    );

    border: 1px solid #199ff0;

    box-shadow:
        0 0 18px rgba(0,160,255,.15);
}

.total-title {

    color: #53c7ff;

    font-size: 18px;
}

.total-power {

    font-size: 34px;

    font-weight: bold;

    color: #6bcaff;

    margin-top: 5px;
}


/* ==================================================
   SPODN� INFORMACE
   ================================================== */



.info-card {

    position: relative;
    
   // left: 260px;
   // right: 265px;

    //background: #131c2b;
    
        background: linear-gradient(
        145deg,
        rgba(29, 41, 59, 0.75),
        rgba(17, 25, 39, 0.75)
    );

    border: 3px solid #32537E;

    border-radius: 5px;

    padding: 15px ;
    margin: 0px 45px 0px 25px;

    width: auto;
    height: 200px;
    text-align: center;
    
}

.info-card-title {

    color: #9baac0;

    font-size: 14px;

    margin-bottom: 5px;
}

.info-card-value {

    font-size: 21px;

    font-weight: bold;
}

#bg-filter {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Stoj� nad ob�ma obr�zky (-1001 a -1002), ale pod textem (0+) */
    z-index: -1000; 

    /* MODERN� FILTR: Ztmav� pozad� pod sebou na 65 % p�vodn�ho jasu */
    backdrop-filter: brightness(95%);
    -webkit-backdrop-filter: brightness(95%); /* Podpora pro Safari */

    /* Z�LO�N� �E�EN�: Pokud prohl�e� neum� backdrop-filter, 
       pou�ije se klasick� �ern� s 35% pr�hlednost� */
    background-color: rgba(0, 0, 0, 0.35); 
}

.tabulka {

    position: absolute;

   // right: 45px;
  left: 50%;
  //top: 330px;
    bottom: 35px;
    transform: translateX(-50%); //p�id�no

    width: 280px;
   // height:  220px;
    padding: 10px;

    border-radius: 5px;
    
    
    background: linear-gradient(
        145deg,
        rgba(29, 41, 59, 0.75),
        rgba(17, 25, 39, 0.75)
    );

    border: 2px solid #aebbc4;

    box-shadow:
        0 0 25px rgba(0,130,255,.25),
        inset 0 0 20px rgba(255,255,255,.15);

    //color: #101820;

    z-index: 5;
}

table {
            width: 100%;
           
            border-radius: 5px;
            font-family: Arial, sans-serif;
        }
        th, td {
            border: 1px solid #cccccc;
            padding: 8px 12px;
            text-align: left;
        }
        th {
            background-color: #0c4570;
        }



/* ==================================================
   MOBIL
   ================================================== */

@media (max-width: 950px) and (max-height: 800px) {

    html,
    body {
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }

    .container {
        width: 1300px;
        max-width: none;
        margin: 0;
        padding: 20px 25px 35px;
        zoom: 36%;
    }

    .house,
    .battery {
        right: 90px;
    }

}



/* ==================================================
   ENERGETICKÁ HISTORIE / GRAF
   ================================================== */

.info-card {
    position: relative;
    box-sizing: border-box;
    height: 285px;
    padding: 10px 18px 12px;
    overflow: hidden;
}

.history-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 3px;
}

.history-button {
    border: 1px solid #53667c;
    border-radius: 5px;
    padding: 5px 12px;
    background: #18283b;
    color: #b9c7d8;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.history-button:hover {
    background: #213a54;
}

.history-button.active {
    background: #0c4570;
    border-color: #6bcaff;
    color: white;
}

.history-title {
    color: #d9e5f2;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 2px;
}

#history-chart {
    display: block;
    width: 100%;
    height: 210px;
    max-width: 100%;
    cursor: pointer;
    touch-action: manipulation;
}

/* --------------------------------------------------
   HISTORIE – BUBLINOVÁ NÁPOVĚDA
   -------------------------------------------------- */

.history-tooltip {
    position: absolute;
    z-index: 20;
    min-width: 170px;
    padding: 9px 11px;
    border-radius: 6px;

    background: rgba(20, 29, 42, 0.96);
    border: 1px solid #71859b;

    box-shadow:
        0 5px 18px rgba(0, 0, 0, 0.35),
        inset 0 0 10px rgba(255, 255, 255, 0.04);

    color: #d9e5f2;
    font-family: Arial, sans-serif;
    font-size: 12px;
    line-height: 1.45;

    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.08s ease;
}

.history-tooltip.visible {
    opacity: 1;
    visibility: visible;
}

.history-tooltip-date {
    margin-bottom: 5px;
    color: #ffffff;
    font-weight: bold;
}

.history-tooltip-row {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.history-tooltip-row strong {
    margin-left: auto;
    padding-left: 8px;
    color: #ffffff;
}

.history-tooltip-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
}

.history-tooltip-dot.pv {
    background: #38bdf8;
}

.history-tooltip-dot.load {
    background: #ffc832;
}


/* Souhrnná tabulka energie */
#energy-summary td {
    min-width: 78px;
}

#energy-summary td:nth-child(2),
#energy-summary td:nth-child(3) {
    font-weight: bold;
}

hr {
    position: relative;
    left: -15px;
    width: calc(100% - 69px);
    
}


/* ==================================================
   HISTORIE – MENŠÍ OBRAZOVKA
   ================================================== */

@media (max-width: 1100px) {

    .info-card {
        left: 245px;
        right: 245px;
        height: 265px;
        padding: 8px 12px 10px;
    }

    .history-controls {
        gap: 5px;
    }

    .history-button {
        padding: 4px 10px;
        font-size: 11px;
    }

    .history-title {
        font-size: 13px;
    }

    #history-chart {
        height: 195px;
    }
}




/* ==================================================
   HISTORIE – OPRAVDU ÚZKÁ OBRAZOVKA
   ================================================== */

@media (max-width: 850px) {

    .info-card {
        left: 180px;
        right: 180px;
        height: 255px;
        padding: 7px 8px 8px;
    }

    .history-controls {
        gap: 4px;
    }

    .history-button {
        padding: 3px 8px;
        font-size: 10px;
    }

    #history-chart {
        height: 185px;
    }
}
