* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    transition: background 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    position: relative;
}

.theme-toggle {
    position: absolute;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.theme-toggle .sun,
.theme-toggle .moon {
    position: absolute;
    transition: opacity 0.3s ease;
}

.theme-toggle .moon {
    opacity: 0;
}

body.dark-mode .theme-toggle .sun {
    opacity: 0;
}

body.dark-mode .theme-toggle .moon {
    opacity: 1;
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    position: relative;
}

.theme-toggle {
    position: absolute;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.theme-toggle .sun,
.theme-toggle .moon {
    position: absolute;
    transition: opacity 0.3s ease;
}

.theme-toggle .moon {
    opacity: 0;
}

body.dark-mode .theme-toggle .sun {
    opacity: 0;
}

body.dark-mode .theme-toggle .moon {
    opacity: 1;
}

.last-updated {
    font-size: 0.9rem;
    opacity: 0.9;
}

.charger-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
    justify-content: center;
}

/* For tablet and up, show 2 columns */
@media (min-width: 768px) {
    .charger-grid {
        grid-template-columns: repeat(2, minmax(320px, 400px));
        max-width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }
}

/* For desktop, show 3 columns max */
@media (min-width: 1200px) {
    .charger-grid {
        grid-template-columns: repeat(3, minmax(360px, 420px));
    }
}
.charger-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease;
}

/* Available - Green background */
.charger-card.status-available {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

/* In use - Pulsing blue background */
.charger-card.status-charging,
.charger-card.status-preparing {
    background: linear-gradient(135deg, #cce5ff 0%, #b8daff 100%);
    animation: pulse 3s ease-in-out infinite;
}

/* Completed/Suspended - Yellow background */
.charger-card.status-suspended,
.charger-card.status-finishing {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
}

/* Bad status - Red background */
.charger-card.status-error,
.charger-card.status-unavailable,
.charger-card.status-offline,
.charger-card.status-occupied {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
}

/* Reserved - Orange background */
.charger-card.status-reserved {
    background: linear-gradient(135deg, #ffe5d0 0%, #ffd8b8 100%);
}

/* Unknown - Grey background */
.charger-card.status-unknown {
    background: linear-gradient(135deg, #e2e3e5 0%, #d6d8db 100%);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), 0 0 10px rgba(0, 123, 255, 0.3);
    }
    50% {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), 0 0 25px rgba(0, 123, 255, 0.7);
    }
}

.charger-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.charger-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.charger-id {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    transition: color 0.3s ease;
}

.status-badge {
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1.3;
    max-width: 200px;
    text-align: center;
}

.status-available {
    background-color: #28a745;
    color: white;
}

.status-charging,
.status-preparing {
    background-color: #007bff;
    color: white;
}

.status-suspended,
.status-finishing {
    background-color: #ffc107;
    color: #000;
}

.status-offline,
.status-error,
.status-unavailable,
.status-occupied {
    background-color: #dc3545;
    color: white;
}

.status-reserved {
    background-color: #fd7e14;
    color: white;
}

.status-unknown {
    background-color: #6c757d;
    color: white;
}

.charger-details {
    margin-top: 16px;
}

.comment-section {
    margin-top: 12px;
}

.comment-input-wrapper {
    display: flex;
    gap: 8px;
}

.comment-input {
    flex: 1;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 0.9rem;
    background: white;
    color: #333;
    transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.save-comment-btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #667eea;
    background: #667eea;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease;
    white-space: nowrap;
}

.save-comment-btn:hover {
    background: #5568d3;
    border-color: #5568d3;
}

.comment-input:focus {
    outline: none;
    border-color: #667eea;
}

body.dark-mode .comment-input {
    background: #1a1a1a !important;
    border: 1px solid #444 !important;
    color: #e0e0e0 !important;
}

body.dark-mode .comment-input:focus {
    border-color: #00d9ff;
    box-shadow: 0 0 5px rgba(0, 217, 255, 0.3);
}

body.dark-mode .comment-input::placeholder {
    color: #666;
}

body.dark-mode .save-comment-btn {
    background: #00d9ff;
    border-color: #00d9ff;
    color: #000;
}

body.dark-mode .save-comment-btn:hover {
    background: #00b8d9;
    border-color: #00b8d9;
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.95rem;
}

.detail-label {
    color: #666;
    font-weight: 500;
    transition: color 0.3s ease;
}

.detail-value {
    color: #333;
    font-weight: 600;
    transition: color 0.3s ease;
}

.availability-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.available {
    background-color: #28a745;
}

.unavailable {
    background-color: #dc3545;
}

.loading {
    text-align: center;
    color: white;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    margin-top: 40px;
    font-size: 0.9rem;
}

footer a {
    color: #a5b4fc;
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    color: #c7d2fe;
    text-decoration: underline;
}

body.dark-mode footer a {
    color: #00d9ff;
}

body.dark-mode footer a:hover {
    color: #66e6ff;
    text-decoration: underline;
}

footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

body.dark-mode footer a {
    color: #00d9ff;
}

body.dark-mode footer a:hover {
    color: #66e6ff;
}

/* Dark Mode - Tron style */
body.dark-mode {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
}

body.dark-mode .charger-card {
    background: #0a0e1a;
    color: #e0e0e0;
    border: 2px solid #1a2332;
}

/* Dark mode - Available green (Tron neon) */
body.dark-mode .charger-card.status-available {
    background: #0a1410;
    border: 2px solid #00ff9f;
    box-shadow: 0 0 20px rgba(0, 255, 159, 0.3), inset 0 0 20px rgba(0, 255, 159, 0.1);
    color: #00ff9f;
}

/* Dark mode - Charging blue (Tron neon pulsing) */
body.dark-mode .charger-card.status-charging,
body.dark-mode .charger-card.status-preparing {
    background: #0a0e1a;
    border: 2px solid #00d9ff;
    color: #00d9ff;
    animation: pulseDark 3s ease-in-out infinite;
}

/* Dark mode - Suspended yellow (Tron neon) */
body.dark-mode .charger-card.status-suspended,
body.dark-mode .charger-card.status-finishing {
    background: #1a1410;
    border: 2px solid #ffcc00;
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.3), inset 0 0 20px rgba(255, 204, 0, 0.1);
    color: #ffcc00;
}

/* Dark mode - Error red (Tron neon) */
body.dark-mode .charger-card.status-error,
body.dark-mode .charger-card.status-unavailable,
body.dark-mode .charger-card.status-offline,
body.dark-mode .charger-card.status-occupied {
    background: #1a0a0a;
    border: 2px solid #ff0040;
    box-shadow: 0 0 20px rgba(255, 0, 64, 0.3), inset 0 0 20px rgba(255, 0, 64, 0.1);
    color: #ff0040;
}

/* Dark mode - Reserved orange (Tron neon) */
body.dark-mode .charger-card.status-reserved {
    background: #1a0f0a;
    border: 2px solid #ff6600;
    box-shadow: 0 0 20px rgba(255, 102, 0, 0.3), inset 0 0 20px rgba(255, 102, 0, 0.1);
    color: #ff6600;
}

/* Dark mode - Unknown grey (Tron neon) */
body.dark-mode .charger-card.status-unknown {
    background: #0f0f0f;
    border: 2px solid #666666;
    box-shadow: 0 0 20px rgba(102, 102, 102, 0.2), inset 0 0 20px rgba(102, 102, 102, 0.1);
    color: #999999;
}
@keyframes pulseDark {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 217, 255, 0.4), inset 0 0 20px rgba(0, 217, 255, 0.1);
        border-color: #00d9ff;
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 217, 255, 0.8), inset 0 0 30px rgba(0, 217, 255, 0.2);
        border-color: #66e6ff;
    }
}

body.dark-mode .charger-id {
    color: #e0e0e0;
}

body.dark-mode .charger-header {
    border-bottom-color: #3a3a3a;
}

body.dark-mode .detail-label {
    color: #a0a0a0;
}

body.dark-mode .detail-value {
    color: #e0e0e0;
}

body.dark-mode .error-message {
    background-color: #3d1f1f;
    color: #ff6b6b;
    border-color: #5a2a2a;
}

body.dark-mode .status-available {
    background-color: #1e4620;
    color: #4ade80;
}

body.dark-mode .status-charging,
body.dark-mode .status-preparing {
    background-color: #0a2a3a;
    color: #00d9ff;
}

body.dark-mode .status-suspended,
body.dark-mode .status-finishing {
    background-color: #3a2f0a;
    color: #ffcc00;
}

body.dark-mode .status-offline,
body.dark-mode .status-error {
    background-color: #4a1a1a;
    color: #f87171;
}

body.dark-mode .status-unknown {
    background-color: #2a2a2a;
    color: #9ca3af;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .charger-grid {
        grid-template-columns: 1fr;
    }
    
    .header-top {
        flex-direction: column;
        gap: 10px;
    }
    
    .theme-toggle {
        position: static;
    }
}
    .header-top {
        flex-direction: column;
        gap: 10px;
    }
    
    .theme-toggle {
        position: static;
    }
}
