/**
 * GPU-M Log Analyzer - Stylesheet
 * Author: Bogdan Anton - GraphixLAB CH
 * Contact: contact@graphixlab.ch
 * Copyright Ã‚Â© 2025 GraphixLAB CH. All rights reserved.
 * This file contains the styles for the UI, tables, buttons, and graphs.
 */

/* ===================== Global Styles ===================== */
body {
    font-family: "Outfit", sans-serif !important;
    background-color: #232323;
    text-align: center;
    padding: 20px;
}

/* ===================== Main Container ===================== */
.container {
    max-width: 100%;
    max-height: 100%;
    background: #f4f4f4;
    padding: 20px;
    margin: auto;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

/* ===================== Headings ===================== */
h1 {
    font-weight: 700;
    font-size: 50px;
    text-align: center;
    word-wrap: break-word;  /* Rupe cuvintele prea lungi */
    overflow-wrap: break-word; /* Se asigură că textul rămâne în container */
    white-space: normal;  /* Permite trecerea la linia următoare */
}

h2 {
    font-weight: 700;
    font-size: 25px;
    text-align: center;
    word-wrap: break-word;  /* Rupe cuvintele prea lungi */
    overflow-wrap: break-word; /* Se asigură că textul rămâne în container */
    white-space: normal;  /* Permite trecerea la linia următoare */
}

h3 {
    font-weight: 700;
    font-size: 25px;
    text-align: center;
    color: #fff;
    word-wrap: break-word;  /* Rupe cuvintele prea lungi */
    overflow-wrap: break-word; /* Se asigură că textul rămâne în container */
    white-space: normal;  /* Permite trecerea la linia următoare */

}

h4 {
    font-weight: 500;
    font-size: 20px;
    word-wrap: break-word;  /* Rupe cuvintele prea lungi */
    overflow-wrap: break-word; /* Se asigură că textul rămâne în container */
    white-space: normal;  /* Permite trecerea la linia următoare */
}

B2 {
    font-weight: 700;
    font-size: 25px;
    text-align: center;
    color: #232323;
    word-wrap: break-word;  /* Rupe cuvintele prea lungi */
    overflow-wrap: break-word; /* Se asigură că textul rămâne în container */
    white-space: normal;  /* Permite trecerea la linia următoare */
}

/* ===================== Typography & Fonts ===================== */
@font-face {
    font-family: 'Outfit';
    src: url('/static/fonts/Outfit.ttf') format('truetype'); 
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

.outfit-bold {
    font-weight: 700;
}

.outfit-light {
    font-weight: 300;
}

input, button {
    margin-top: 50px;
    margin-bottom: 50px;
    padding: 10px;
    font-size: 16px;
    font-family: "Outfit", sans-serif;
}

/* ===================== Tables ===================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: white;
}

th, td {
    border: 1px solid #dddddd75;;
    padding: 8px;
}

th {
    background: #2f68bd;
    color: white;
}

 #tableTitle {
     font-size: 40px;
     font-weight: 700;
 }

/* ===================== Charts ===================== */
#chartsContainer {
    display: none;
    margin-top: 20px;
}

.chart-row {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.chart-box {
    background: white;
    padding: 15px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    width: 30%;
}

 #ChartTitle {
     font-size: 40px;
     font-weight: 700;
 }
/* ===================== Buttons ===================== */
.button-container {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
    margin-top: 10px;
}

#analyzeButton, .custom-file-button, #resetButton {
    font-size: 16px;
    font-weight: bold;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

#analyzeButton {
    background-color: #2f68bd;
    color: white;
    height: 43px;
}

#analyzeButton:hover {
    background-color: #26539b;
    transform: scale(1.05);
}

#analyzeButton:active {
    transform: scale(0.98);
}

#analyzeButton:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.custom-file-button {
    background-color: #232323;
    color: white;
}

.custom-file-button:hover {
    background-color: #26539b;
    transform: scale(1.05);
}

.custom-file-button:active {
    transform: scale(0.98);
}

#resetButton {
    background-color: red;
    color: white;
    height: 43px;
}

#resetButton:hover {
    background-color: #c9302c;
    transform: scale(1.05);
}

#resetButton:active {
    transform: scale(0.98);
}

/* ===================== File Upload ===================== */
.file-upload {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid #232323;
    padding-right: 10px;
}

#fileInput {
    display: none;
}

#fileName {
    font-size: 14px;
    color: #555;
}

/* ===================== Chart Indicators (Colored Dots) ===================== */
.chart-status {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
}

/* Pulsing Effect for Red Indicators */
.pulse {
    animation: pulse-animation 1.5s infinite;
}

@keyframes pulse-animation {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* ===================== Table Container ===================== */
#tableContainer {
    display: none;
    margin-top: 20px;
    text-align: center;
}

/* ===================== Chart Legend ===================== */
#chartsLegend {
    display: none;
    text-align: center;
    margin-top: 20px;
}

.gpu-legend {
    font-size: 16px;
    font-weight: bold;
    color: #232323; 
}

.legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    font-size: 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-color {
    display: inline-block;
    width: 15px;
    height: 15px;
    border-radius: 50%;
}

/* Legend Colors */
.normal .legend-color { background-color: green; }
.warning .legend-color { background-color: orange; }
.danger .legend-color { background-color: red; animation: pulse-animation 1.5s infinite; }

/* ===================== Info Container ===================== */
#infoContainer {
    background-color: #fff;
    padding: 35px;
    text-align: center;
    max-width: 600px;
    margin: 20px auto;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

#infoContainer p {
    color: #232323;
}

#infoContainer ul {
    text-align: left;
    display: inline-block;
    margin: 10px auto;
    padding: 0;
    list-style-position: inside;
    color: #232323;
}

/* ===================== Summary Container ===================== */
#summaryContainer {
    flex: 1;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease-in-out;
}

.summary {
    flex: 1;
    padding: 35px;
    white-space: nowrap;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

.summary p, .summary ul {
    display: inline-block;
    text-align: left;
    color: #fff;
    word-wrap: break-word;  /* Rupe cuvintele prea lungi */
    overflow-wrap: break-word; /* Se asigură că textul rămâne în container */
    white-space: normal;  /* Permite trecerea la linia următoare */
}

.summary img {
    width: 80px;
    margin-bottom: 10px;
}

/* Summary Color Themes */
.summary.warning {
    flex: 1;
    background-color: orange;
     border-radius: 10px;
     border: 10px solid #fff;
     position: relative;
}
.summary.critical { 
    background-color: #c9302c;
      border-radius: 10px;
      border: 10px solid #fff;
      position: relative;
    
}
.summary.normal { 
    background-color: green;
      border-radius: 10px;
      border: 10px solid #fff;
      position: relative;
      margin-top: 20px;
      padding-top: 80px;
      padding-bottom: 80px;
    
}


/* ===================== Min/Max Values Under Charts ===================== */
.min-max {
    font-size: 16px;
    color: #666;
    display: block;
    margin-top: 5px;
    text-align: center;
}

.min-max strong {
    color: #333;
}

/* ===================== Footer Styling ===================== */
.footer {
    text-align: center;
    font-size: 16px;
    color: #fff;
    margin-top: 20px;
    padding: 10px;
    color: white;
    width: 100%;
    position: relative;
    bottom: 0;
}

.footer a {
    color: white; /* Match footer text color */
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #2f68bd; /* Highlight color on hover */
}

/* ===== Header Styling ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.header-left,
.header-center,
.header-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-left {
    justify-content: flex-end;
}

.header-right {
    justify-content: flex-start;
}

.header-center img {
    max-width: 350px;
    cursor: pointer;
}

.header-left ul,
.header-right ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.header-left a,
.header-right a {
    color: #232323;
    text-decoration: none;
    font-weight: 700;
    font-size: 20px;
    transition: color 0.3s ease-in-out;
}

.header-left a:hover,
.header-right a:hover {
    color: #2f68bd;
}

#preloader {
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: #09121e;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.loader {
    position: relative;
    width: 80px;
    height: 80px;
}

.graph-loader {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 5px solid #2f68bd; /* Blue */
    border-top-color: transparent;
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#siteLogo {
    display: block;
    width: 350px;
    height: auto;
    cursor: pointer;
}

.copyright-content p {
    text-align: left;
}

/* Submenu Styling */
.submenu-container {
    position: relative;
}

.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    min-width: 180px;
    z-index: 999;
}

.submenu li {
    list-style: none;
    padding: 0;
}

.submenu li a {
    display: block;
    padding: 10px;
    color: #232323;
    text-decoration: none;
}

.submenu li a:hover {
    background: #2f68bd;
    color: #fff;
    border-radius: 3px;
}

/* Show submenu on hover */
.submenu-container:hover .submenu {
    display: block;
}

/* Dark Mode Support */
.dark-mode .submenu {
    background: #09121e;
}

.dark-mode .submenu li a {
    color: #fff;
}

.dark-mode .submenu li a:hover {
    background: #2f68bd;
}

#gpuDropdown {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    font-size: 16px;
    font-weight: 600; 
    border: 2px solid #007bff;
    background: #ffffff;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none; /* Remove default dropdown styling */
    outline: none;
}

/* Dropdown Arrow Customization */
#gpuDropdown::-ms-expand {
    display: none; /* Hide default arrow in IE */
}
#gpuDropdown:hover {
    border-color: #0056b3;
}
#gpuDropdown:focus {
    border-color: #0056b3;
}

#dev-popup {
    position: fixed;
    padding: 10px 20px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    z-index: 9999;
    animation: moveRandom 15s infinite linear alternate;
}

@keyframes moveRandom {
    0% { top: 10%; left: 10%; }
    25% { top: 50%; left: 30%; }
    50% { top: 70%; left: 70%; }
    75% { top: 20%; left: 60%; }
    100% { top: 40%; left: 20%; }
}

/* ðŸ”¹ Stilizare generalÄƒ pentru pragurile oficiale */
.graph-subtitle {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin-top: 8px; /* SpaÈ›iu Ã®ntre grafic È™i praguri */
    padding: 5px;
    border-radius: 5px;
    color: #232323;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px; /* SpaÈ›iu Ã®ntre titlu È™i valori */
}

/* ðŸ”¹ Titlul pragurilor oficiale */
.graph-subtitle .subtitle-title {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
    margin-right: 15px; /* SpaÈ›iu Ã®ntre titlu È™i praguri */
}

/* ðŸ”¹ Pragurile oficiale (aliniate pe aceeaÈ™i linie) */
.graph-subtitle .subtitle-values {
    display: flex;
    align-items: center;
    gap: 20px; /* SpaÈ›iu Ã®ntre pragurile safe, warning È™i danger */
}

/* ðŸ”¹ Stilizare praguri individuale */
.threshold {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
}

/* ðŸ”¹ Puncte colorate */
.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* ðŸ”¹ Culori pentru fiecare prag */
.safe-dot { background-color: green; }
.warning-dot { background-color: orange; }
.danger-dot { background-color: red; }


/* Stil pentru alinierea containerelor */
.container-row {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    width: 100%;
    margin: 20px auto;
    background-color: #fff;
    border-radius: 10px;
    padding-bottom: 10px;
    padding-top: 10px;
}

/* Stil individual pentru containere */
.summary-box {
    flex: 1;  /* Acest lucru asigură că toate sunt egale */
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    transition: all 0.3s ease-in-out;
    min-width: 30%;  /* Previne ca unul să fie prea mic */
    max-width: 33%;  /* Asigură echilibru */
}

/* Spațiere între containere */
.summary-box:not(:last-child) {
    margin-right: 20px;
}

/* Ascundere inițială pentru containerul din mijloc */
.hidden {
    display: none;
}
