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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    min-height: 100vh;
    color: #333;
}

.main-view, .account-view, .charger-detail-view {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.balance-display {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.icon-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

/* Loading Overlay - Centered */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 18px;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* Screens */
.screen {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 80px;
}

.screen.active {
    display: block;
}

/* Stations List */
.stations-list, .sessions-list {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

/* Charger Cards */
.charger-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.charger-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.charger-card.charger-active {
    border: 2px solid #4CAF50;
    background: linear-gradient(to right, #ffffff, #e8f5e9);
}

.charger-card.charger-offline {
    opacity: 0.6;
}

.charger-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.charger-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.charger-location {
    font-size: 13px;
    color: #666;
}

.connection-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.connection-badge.connected {
    background: #e8f5e9;
    color: #2e7d32;
}

.connection-badge.offline {
    background: #ffebee;
    color: #c62828;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.status-available {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-charging {
    background: #fff3e0;
    color: #e65100;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.status-occupied {
    background: #fff3e0;
    color: #f57c00;
}

.status-unavailable {
    background: #fce4ec;
    color: #c2185b;
}

.charger-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
    flex-wrap: wrap;
}

.charger-power, .charger-price {
    font-size: 14px;
    color: #666;
}

.charger-price {
    color: #4CAF50;
    font-weight: 500;
}

/* Live Energy Display */
.live-energy {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.energy-meter {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.energy-value {
    color: #ffd700;
}

.energy-cost {
    font-size: 14px;
    opacity: 0.9;
}

/* Charger Actions */
.charger-actions {
    display: flex;
    gap: 8px;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger, .btn-small {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-danger {
    background: linear-gradient(135deg, #f44336 0%, #e91e63 100%);
    color: white;
}

.btn-danger:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
    width: auto;
}

/* Session Cards */
.session-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.session-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

/* Account View */
.account-container {
    flex: 1;
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.account-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.account-card h2 {
    margin-bottom: 16px;
    color: #333;
}

.account-info {
    margin: 20px 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-label {
    color: #666;
    font-weight: 500;
}

.info-value {
    color: #333;
    font-weight: 600;
}

.balance-value {
    color: #4CAF50;
    font-size: 18px;
}

.input-field {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 16px;
    transition: border-color 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: #10b981;
}

/* Payment Methods */
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-method {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
}

.modal-content h3 {
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* Charger Detail View */
.detail-container {
    flex: 1;
    padding: 16px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.detail-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.detail-card h2 {
    margin-bottom: 12px;
    color: #333;
}

.detail-info {
    margin: 24px 0;
}

.live-energy-detail {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
}

.live-energy-detail h3 {
    margin-bottom: 16px;
}

.energy-display {
    text-align: center;
}

.energy-big {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.energy-cost-big {
    font-size: 20px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.energy-duration {
    font-size: 16px;
    opacity: 0.8;
}

.detail-actions {
    margin-top: 24px;
}

.info-message {
    text-align: center;
    padding: 16px;
    background: #f5f5f5;
    border-radius: 8px;
    color: #666;
}

/* Tab Bar */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    z-index: 100;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.tab-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.tab-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.tab-label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
}

.tab-item.active .tab-label {
    color: #10b981;
    font-weight: 600;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: white;
    font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 20px;
    }
    
    .balance-display {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .charger-name {
        font-size: 16px;
    }
    
    .energy-big {
        font-size: 28px;
    }
}

/* User Active Session Styling */
.user-active-session {
    border: 3px solid #4CAF50;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.3);
    position: relative;
}

.user-session-badge {
    display: block;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    border-radius: 12px 12px 0 0;
    margin: -16px -16px 12px -16px;
}

.user-active-session .live-energy {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

/* Map View Styles */
.view-toggle {
    display: flex;
    gap: 8px;
    padding: 20px 16px 16px 16px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 72px;
    z-index: 90;
    margin-bottom: 8px;
}

.toggle-btn {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #10b981;
    background: white;
    color: #10b981;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.toggle-btn:hover:not(.active) {
    background: #f5f7ff;
}

#nearby-btn {
    flex: 0 0 auto;
    min-width: 120px;
}

.stations-map {
    height: calc(100vh - 200px);
    width: 100%;
    position: relative;
}

.gm-style .gm-style-iw-c {
    border-radius: 12px;
    padding: 12px;
}

.gm-style .gm-style-iw-d {
    overflow: auto !important;
}

.map-info-window {
    min-width: 200px;
}

.map-info-window h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
}

.map-info-window .charger-info {
    margin: 8px 0;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 6px;
}

.map-info-window .distance {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: #666;
    font-size: 14px;
}

.map-info-window .view-details-btn {
    margin-top: 12px;
    width: 100%;
    padding: 8px 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.nearby-panel {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    max-width: 90%;
    z-index: 1000;
}

.nearby-panel h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
}

.nearby-station {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.nearby-station:last-child {
    border-bottom: none;
}

.nearby-station-name {
    font-weight: 600;
    color: #333;
}

.nearby-station-distance {
    color: #10b981;
    font-size: 14px;
}

/* Custom Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-container {
    background: white;
    border-radius: 16px;
    max-width: 90%;
    width: 400px;
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.modal-body {
    padding: 24px;
}

.modal-message {
    font-size: 16px;
    line-height: 1.6;
    color: #4b5563;
    margin-bottom: 0;
    white-space: pre-line;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.modal-btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.modal-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.modal-btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
}

.modal-btn-secondary:hover {
    background: #e5e7eb;
}

.modal-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.modal-btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
    text-align: center;
}

.modal-icon-success { color: #10b981; }
.modal-icon-error { color: #ef4444; }
.modal-icon-warning { color: #f59e0b; }
.modal-icon-info { color: #3b82f6; }
.modal-icon-question { color: #6366f1; }

