/* Set Bookman Old Style as the default font for all elements */
* {
    font-family: 'Bookman Old Style', 'Bookman', serif;
}

body {
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

header {
    background-color: #4CAF50;
    color: white;
    padding: 20px;
    position: relative;
    display: flex;
    align-items: center;
}

/* Logo styling - doubled size and positioned on left */
.logo {
    height: 120px; /* Doubled size */
    margin-right: 30px;
}

.header-text {
    flex: 1;
}

h1, h2 {
    margin: 0;
}

.subtitle {
    margin-top: 5px;
    font-size: 1rem;
}

.user-info {
    position: absolute;
    top: 10px;
    right: 20px;
    color: white;
}

.user-info a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    background-color: #388E3C;
    border-radius: 4px;
    margin-left: 10px;
}

nav {
    background-color: #388E3C;
    padding: 10px 0;
}

nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

nav li {
    margin: 0 15px;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
}

nav a.active {
    background-color: #2E7D32;
}

main {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

section {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stats-box {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    background-color: #e8f5e9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #388E3C;
}

.stat-label {
    font-size: 0.9rem;
    color: #689F38;
}

button {
    padding: 10px 15px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#status {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.chargers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.charger-card {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
}

.charger-card h3 {
    margin: 0;
    padding: 15px;
    background-color: #f5f5f5;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Added to position status badge */
}

.charger-title {
    display: flex;
    align-items: center;
}

.charger-info {
    padding: 15px;
}

.charger-info p {
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
}

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-online {
    background-color: #4CAF50;
}

.status-offline {
    background-color: #F44336;
}

.status-charging {
    background-color: #2196F3;
}

.charger-card.online {
    border-left: 5px solid #4CAF50;
}

.charger-card.offline {
    border-left: 5px solid #F44336;
}

.charger-card.charging {
    border-left: 5px solid #2196F3;
}

.control-buttons {
    padding: 15px;
    text-align: center;
}

button.start {
    background-color: #4CAF50;
}

button.stop {
    background-color: #F44336;
}

footer {
    text-align: center;
    padding: 20px;
    color: #666;
}

.auto-refresh-indicator {
    display: inline-block;
    margin-left: 10px;
    font-size: 0.8rem;
    color: #689F38;
}

/* Enhanced Gauge styles */
.gauge-wrapper {
    position: relative;
    width: 240px;
    height: 140px;
    margin: 0 auto;
    padding-top: 10px;
}

.gauge-container {
    width: 200px;
    height: 100px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    border-radius: 100px 100px 0 0;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
    background: #f0f0f0;
}

.gauge-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to top, #4CAF50, #8BC34A);
    transition: height 0.5s ease-out;
    border-radius: 0 0 100px 100px;
}

.gauge-cover {
    width: 160px;
    height: 80px;
    background: white;
    border-radius: 80px 80px 0 0;
    position: absolute;
    bottom: 0;
    left: 20px;
    box-shadow: 0 -3px 6px rgba(0,0,0,0.1);
}

.gauge-needle {
    width: 4px;
    height: 90px;
    background-color: #333;
    position: absolute;
    bottom: 0;
    left: 98px;
    transform-origin: bottom center;
    transform: rotate(0deg);
    z-index: 10;
    transition: transform 1s ease-out;
    border-radius: 2px 2px 0 0;
}

.gauge-needle:after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: -6px;
    width: 16px;
    height: 16px;
    background-color: #333;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

.gauge-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: #333;
    margin-top: 15px;
    text-align: center;
}

.gauge-label {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
    text-align: center;
}

.gauge-min-max {
    display: flex;
    justify-content: space-between;
    width: 200px;
    margin: 5px auto 0;
    font-size: 0.8rem;
    color: #666;
}

.gauge-min {
    text-align: left;
}

.gauge-max {
    text-align: right;
}

.gauge-ticks {
    position: absolute;
    width: 200px;
    height: 100px;
    bottom: 0;
    left: 0;
}

.gauge-tick {
    position: absolute;
    width: 2px;
    height: 6px;
    background-color: rgba(0,0,0,0.3);
    bottom: 0;
    transform-origin: center bottom;
}

.gauge-tick.major {
    height: 10px;
    width: 3px;
    background-color: rgba(0,0,0,0.5);
}

.energy-info {
    margin-top: 20px;
    text-align: center;
    padding: 12px;
    background-color: #f1f8e9;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.energy-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #388E3C;
}

.energy-label {
    font-size: 0.9rem;
    color: #689F38;
    margin-top: 5px;
}

.power-meter {
    margin-top: 20px;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
}

/* Style for status badge */
.status-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.status-badge.on {
    background-color: #4CAF50;
}

.status-badge.ready {
    background-color: #FF9800;
}

.status-badge.unknown {
    background-color: #9E9E9E;
}

.status-badge.off {
    background-color: #F44336;
}

/* Last seen timestamp */
.last-seen {
    font-size: 0.8rem;
    color: #999;
    margin-top: 5px;
    text-align: right;
}

/* Offline warning */
.offline-warning {
    color: #F44336;
    font-size: 0.9rem;
    margin-top: 5px;
    font-weight: bold;
}

/* Global tooltip container */
#global-tooltip {
    position: fixed;
    z-index: 9999;
    background-color: #333;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    max-width: 250px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    line-height: 1.4;
}
