@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #475569;
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-primary: #3e3d6a;
    --accent-secondary: #355b84;
    --accent-tertiary: #2b789b;
    --accent-quaternary: #2293b2;
    --accent-quinary: #1aacc7;
    
    --border-primary: #475569;
    --border-secondary: #64748b;
    
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.2);
    --shadow-heavy: rgba(0, 0, 0, 0.4);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

[dir="rtl"] {
    text-align: right;
}

.web-app-container {
    min-height: 100vh;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

.logo-section-top {
    text-align: center;
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.logo-image-top {
    height: 60px;
    width: auto;
    transition: all 0.3s ease;
    filter: brightness(0) invert(1);
}

.logo-image-top:hover {
    transform: scale(1.05);
}

.main-content-container {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    max-width: 1400px;
    padding: 0 2rem;
}

.car-visualization-section {
    flex: 1;
    max-width: 600px;
    height: 600px;
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-primary);
    box-shadow: 0 8px 32px var(--shadow-heavy);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.charging-form-section {
    flex: 1;
    max-width: 500px;
    height: auto;
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-primary);
    box-shadow: 0 8px 32px var(--shadow-heavy);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.car-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100%;
    width: 100%;
}

.car-visualization-container {
    position: relative;
    background: var(--bg-tertiary);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--border-primary);
    box-shadow: 0 8px 32px var(--shadow-heavy);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.car-image-container {
    position: relative;
    width: auto;
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    padding: 20px 0 20px;
}

.car-image {
    max-width: 200px;
    max-height: 345px;
    object-fit: contain;
    transition: all 0.5s ease;
    filter: grayscale(100%) brightness(0.9);
    border-radius: 15px;
    z-index: 1;
    order: 2;
}

.charging-status-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    transition: all 0.8s ease;
    z-index: 2;
    order: 1;
}

.charging-status-image.not-charging {
    opacity: 1;
    transform: scale(1);
}

.not-charging-image {
    margin-left: 15px;
    height: 150px;
    width: auto;
}

.charging-status-image.charging {
    opacity: 0;
    transform: scale(0.8);
    display: none;
}

.charging-image {
    margin-left: -9px;
    margin-bottom: -70px;
    width: auto;
    height: 140px;
}

.charging-status-overlay {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-primary);
    box-shadow: 0 4px 16px var(--shadow-heavy);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.status-dot.connected {
    background: #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.status-dot.disconnected {
    background: var(--text-muted);
}

.status-text {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.progress-ring-container {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    width: 120px;
    height: 120px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px var(--shadow-heavy);
}

.progress-ring-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.progress-ring-bg {
    fill: none;
    stroke: #334155;
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: #10b981;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 326.73;
    stroke-dashoffset: 326.73;
    transition: stroke-dashoffset 0.5s ease;
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.6));
}

.progress-content {
    position: absolute;
    z-index: 2;
    text-align: center;
}

.lightning-icon {
    font-size: 24px;
    margin-bottom: 4px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.progress-text {
    font-size: 18px;
    font-weight: 600;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: 0.5px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.energy-input-section {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--border-primary);
    box-shadow: 0 8px 32px var(--shadow-heavy);
    margin-bottom: 1.5rem;
}

.input-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.input-label i {
    color: var(--accent-primary);
    font-size: 1.2rem;
}

.input-badge {
    background: var(--accent-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.input-wrapper {
    position: relative;
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: inherit;
    cursor: text;
    user-select: text;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-quinary);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(26, 172, 199, 0.1);
    cursor: text;
}

.form-control:hover {
    border-color: var(--accent-quaternary);
    background: var(--bg-card);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.form-control:focus::placeholder {
    opacity: 0.5;
}

.input-focus-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-quinary);
    transition: width 0.3s ease;
}

.form-control:focus + .input-focus-line {
    width: 100%;
}

.input-help {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.input-help i {
    color: var(--accent-primary);
    font-size: 1rem;
}

.input-error {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: none;
}

.input-error.show {
    display: block;
}

/* Virtual Keyboard Styles */
.virtual-keyboard {
    margin-top: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-primary);
    box-shadow: 0 8px 32px var(--shadow-heavy);
    margin-bottom: 1.5rem;
}

.keyboard-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    justify-content: center;
}

.keyboard-row:last-child {
    margin-bottom: 0;
}

.keyboard-key {
    flex: 1;
    min-height: 60px;
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.keyboard-key:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.3);
}

.keyboard-key:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.keyboard-key-delete {
    background: var(--bg-tertiary);
    color: #ef4444;
    border-color: #ef4444;
}

.keyboard-key-delete:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.keyboard-key-clear {
    background: var(--bg-tertiary);
    color: #f59e0b;
    border-color: #f59e0b;
}

.keyboard-key-clear:hover {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

.amount-display-section {
    background: linear-gradient(135deg, var(--accent-quaternary) 0%, var(--accent-quinary) 100%);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 8px 32px var(--shadow-heavy);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

.amount-header {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
    font-weight: 500;
}

.amount-value {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.amount-currency {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    margin-top: 0.5rem;
}

.price-info {
    margin-top: 1rem;
    padding-top: 0;
}

.price-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.price-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
}

.price-label i {
    color: var(--accent-primary);
    font-size: 1rem;
}

.price-value {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.action-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.action-button {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px var(--shadow-heavy);
    position: relative;
    overflow: hidden;
}

.action-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow-heavy);
}

.action-button:active:not(:disabled) {
    transform: translateY(0);
}

.action-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.stop-charging-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

.stop-charging-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
}

.button-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.button-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.success-summary {
    background: linear-gradient(135deg, var(--accent-quaternary) 0%, var(--accent-quinary) 100%);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 8px 32px var(--shadow-heavy);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    margin-top: 1rem;
}

.success-header {
    margin-bottom: 2rem;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: white;
}

.success-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: white;
}

.success-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin: 0;
}

.success-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.detail-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.detail-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-size: 1.2rem;
    color: white;
}

.detail-content {
    text-align: center;
}

.detail-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
}

.detail-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Backend Message Display */
.backend-message {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-primary);
    border-radius: 12px;
    box-shadow: 0 4px 16px var(--shadow-heavy);
}

.message-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.message-content i {
    color: var(--accent-primary);
    font-size: 1.1rem;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-primary);
    border-top: 4px solid var(--accent-quinary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

.loading-text {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 8px;
}

.loading-subtext {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.popup-modal {
    background: var(--bg-secondary);
    border-radius: 24px;
    padding: 0;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-primary);
    overflow: hidden;
    animation: popupSlideIn 0.3s ease-out;
}

/* Error state styling for Mada payment failure */
.popup-modal.popup-error {
    border-color: #ef4444;
    box-shadow: 0 25px 50px -12px rgba(239, 68, 68, 0.4);
}

.popup-modal.popup-error .popup-header {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
}

/* Emphasize header titles for result states */
.popup-modal.popup-success #madaHeaderTitle,
.popup-modal.popup-error #madaHeaderTitle {
    font-size: 1.75rem;
    font-weight: 800;
}

.popup-modal.popup-success #madaHeaderSubtitle,
.popup-modal.popup-error #madaHeaderSubtitle {
    font-size: 1.05rem;
    opacity: 1;
}

/* Result message card */
.result-message {
    width: 100%;
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.popup-modal.popup-success .result-message {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
}

.popup-modal.popup-error .result-message {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
}

.popup-modal.popup-error .popup-icon {
    background: rgba(239, 68, 68, 0.25);
    color: #fecaca;
}

.popup-modal.popup-error .popup-title,
.popup-modal.popup-error .popup-subtitle {
    color: #fee2e2;
}

.popup-modal.popup-error .payment-status {
    color: #fecaca;
}

.popup-modal.popup-error .payment-substatus {
    color: #fecaca;
    opacity: 0.95;
}

.popup-modal.popup-error .payment-spinner {
    border-top-color: #ef4444;
}

.popup-modal.popup-error .popup-btn-primary {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Success state styling for Mada payment success */
.popup-modal.popup-success {
    border-color: #10b981;
    box-shadow: 0 25px 50px -12px rgba(16, 185, 129, 0.35);
}

.popup-modal.popup-success .popup-header {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
}

.popup-modal.popup-success .popup-icon {
    background: rgba(16, 185, 129, 0.25);
    color: #d1fae5;
}

.popup-modal.popup-success .popup-title,
.popup-modal.popup-success .popup-subtitle {
    color: #ecfdf5;
}

.popup-modal.popup-success .payment-status {
    color: #d1fae5;
}

.popup-modal.popup-success .payment-substatus {
    color: #a7f3d0;
    opacity: 0.95;
}

.popup-modal.popup-success .payment-spinner {
    border-top-color: #10b981;
}

.popup-modal.popup-success .popup-btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Body background per state */
.popup-modal.popup-error .popup-body {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
}

.popup-modal.popup-success .popup-body {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.popup-header {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    padding: 2rem;
    text-align: center;
    color: white;
    position: relative;
}

.popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.popup-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: white;
}

.popup-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: white;
}

.popup-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
}

.popup-body {
    padding: 2rem;
    color: var(--text-primary);
}

.popup-details {
    margin-bottom: 2rem;
}

.popup-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-primary);
}

.popup-detail-row:last-child {
    border-bottom: none;
}

.popup-detail-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.popup-detail-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.popup-actions {
    display: flex;
    gap: 1rem;
}

.popup-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.popup-btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    box-shadow: 0 4px 16px var(--shadow-heavy);
}

.popup-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow-heavy);
}

.popup-btn-secondary {
    background: linear-gradient(135deg, var(--accent-tertiary) 0%, var(--accent-quaternary) 100%);
    color: white;
    box-shadow: 0 4px 16px var(--shadow-heavy);
}

.popup-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow-heavy);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content-container {
        flex-direction: column;
        gap: 2rem;
        align-items: center;
        padding: 0 1rem;
    }
    
    .car-visualization-section,
    .charging-form-section {
        max-width: 100%;
        width: 100%;
    }
    
    .car-visualization-section {
        height: 500px;
    }
}

@media (max-width: 768px) {
    .web-app-container {
        padding: 1rem;
    }
    
    .main-content-container {
        gap: 1.5rem;
        padding: 0;
    }
    
    .car-visualization-section,
    .charging-form-section {
        height: auto;
        min-height: 500px;
        padding: 1.5rem;
    }
    
    .car-visualization-section {
        height: 450px;
    }
    
    .car-image-container {
        height: 300px;
    }
    
    .car-image {
        max-width: 150px;
        max-height: 250px;
    }
    
    .charging-status-image {
        width: 100px;
        height: 100px;
    }
    
    .progress-ring-container {
        width: 100px;
        height: 100px;
        bottom: 1rem;
        right: 1rem;
    }
    
    .virtual-keyboard {
        padding: 1rem;
    }
    
    .keyboard-key {
        min-height: 50px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .car-visualization-container {
        padding: 1rem;
    }
    
    .energy-input-section,
    .amount-display-section {
        padding: 1.5rem;
    }
    
    .amount-value {
        font-size: 2rem;
    }
    
    .popup-modal {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
}

/* Mada Payment Loading Popup Styles */
.payment-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 0;
}

.payment-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-primary);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.payment-result-icon {
    font-size: 56px;
    line-height: 1;
}

.popup-modal.popup-success .payment-result-icon {
    color: #d1fae5;
}

.popup-modal.popup-error .payment-result-icon {
    color: #fecaca;
}

.payment-status {
    font-size: 1.2rem;
}

/* Charger Addition Popup Styles */
.charger-instruction {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid var(--border-primary);
}

.instruction-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-quaternary) 0%, var(--accent-quinary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.instruction-text {
    flex: 1;
}

.instruction-text h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.instruction-text ol {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    padding-right: 1rem;
}

.instruction-text li {
    margin-bottom: 0.5rem;
}

.instruction-text li:last-child {
    margin-bottom: 0;
}

/* Charger Addition Popup - Use default popup styling */
#chargerAdditionPopup .popup-modal {
    border-color: var(--border-primary);
    box-shadow: 0 25px 50px -12px var(--shadow-heavy);
}

#chargerAdditionPopup .popup-header {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
}

#chargerAdditionPopup .popup-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

#chargerAdditionPopup .popup-title,
#chargerAdditionPopup .popup-subtitle {
    color: white;
}

#chargerAdditionPopup .popup-body {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

#chargerAdditionPopup .popup-btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    box-shadow: 0 4px 16px var(--shadow-heavy);
}

#chargerAdditionPopup .popup-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow-heavy);
}

#chargerAdditionPopup .popup-btn-secondary {
    background: linear-gradient(135deg, var(--accent-tertiary) 0%, var(--accent-quaternary) 100%);
    color: white;
    box-shadow: 0 4px 16px var(--shadow-heavy);
}

#chargerAdditionPopup .popup-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow-heavy);
}

/* kWh Counter Styles */
.kwh-counter {
    position: absolute;
    bottom: 20px;
    left: 20px;
    border-radius: 12px;
    padding: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-primary);
    z-index: 10;
    animation: slideUp 0.3s ease-out;
    width: fit-content;
    min-width: 120px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kwh-counter-content {
    text-align: center;
}

.kwh-counter-value {
    color: #00ff88;
    font-size: 2.5rem;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
}

.kwh-counter-value.updating {
    animation: counterPulse 0.5s ease-in-out;
}

@keyframes counterPulse {
    0% { 
        transform: scale(1); 
        color: #00ff88;
        text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
    }
    50% { 
        transform: scale(1.1); 
        color: #ffffff;
        text-shadow: 0 0 20px rgba(0, 255, 136, 0.8);
    }
    100% { 
        transform: scale(1); 
        color: #00ff88;
        text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
    }
}

.kwh-counter-unit {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

/* Responsive adjustments for counter */
@media (max-width: 768px) {
    .kwh-counter {
        bottom: 10px;
        left: 10px;
        min-width: 100px;
    }
    
    .kwh-counter-value {
        font-size: 2rem;
    }
    
    .kwh-counter-unit {
        font-size: 0.9rem;
    }
}

.payment-substatus {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    opacity: 0.8;
}

/* Update button icon for payment */
.action-button .bi-credit-card-fill {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

/* Menu Toggle Button */
.menu-toggle-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 12px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(62, 61, 106, 0.3);
    z-index: 1000;
}

.menu-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(62, 61, 106, 0.4);
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-tertiary));
}

.menu-toggle-btn:active {
    transform: translateY(0);
}

/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-overlay.active {
    opacity: 1;
}

/* Menu Popup */
.menu-popup {
    background: linear-gradient(145deg, #1e293b, #334155);
    border-radius: 24px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: scale(0.8) translateY(30px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(62, 61, 106, 0.3);
    position: relative;
}

.menu-popup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.menu-popup.active {
    transform: scale(1) translateY(0);
}

/* Menu Header */
.menu-header {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));
    padding: 2rem 2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.menu-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

.menu-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
    font-weight: 700;
    font-size: 1.3rem;
    position: relative;
    z-index: 1;
}

.menu-title i {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.menu-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.menu-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1) rotate(90deg);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Menu Content */
.menu-content {
    padding: 2rem;
    max-height: calc(85vh - 140px);
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.5), rgba(51, 65, 85, 0.3));
}

.menu-content::-webkit-scrollbar {
    width: 8px;
}

.menu-content::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.3);
    border-radius: 4px;
}

.menu-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-tertiary), var(--accent-quaternary));
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-quaternary), var(--accent-quinary));
}

/* Menu Sections */
.menu-section {
    margin-bottom: 2.5rem;
}

.menu-section:last-child {
    margin-bottom: 0;
}

.menu-section-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(62, 61, 106, 0.2), rgba(53, 91, 132, 0.1));
    border-radius: 12px;
    border: 1px solid rgba(62, 61, 106, 0.3);
    color: var(--accent-quinary);
    font-weight: 700;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
}

.menu-section-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-quinary));
}

.menu-section-title i {
    font-size: 1.3rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Menu Items */
.menu-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.6), rgba(71, 85, 105, 0.4));
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(62, 61, 106, 0.2);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.menu-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.menu-item:hover::before {
    width: 100%;
}

.menu-item:hover::after {
    opacity: 1;
}

.menu-item:hover {
    transform: translateX(-8px) translateY(-2px);
    border-color: var(--accent-primary);
    box-shadow: 
        0 8px 25px rgba(62, 61, 106, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.menu-item:active {
    transform: translateX(-4px) translateY(-1px) scale(0.98);
}

.menu-item-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-tertiary), var(--accent-quaternary));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(43, 120, 155, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-item:hover .menu-item-icon {
    background: linear-gradient(135deg, var(--accent-quaternary), var(--accent-quinary));
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(34, 147, 178, 0.4);
}

.menu-item-content {
    flex: 1;
    position: relative;
    z-index: 2;
}

.menu-item-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.menu-item-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    opacity: 0.9;
}

/* Mobile Menu Styles */
@media (max-width: 768px) {
    .menu-toggle-btn {
        top: 0.75rem;
        left: 0.75rem;
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    
    .menu-popup {
        width: 95%;
        max-height: 90vh;
        margin: 1rem;
        border-radius: 20px;
    }
    
    .menu-header {
        padding: 1.5rem 1.5rem 1.25rem;
    }
    
    .menu-title {
        font-size: 1.2rem;
        gap: 0.75rem;
    }
    
    .menu-title i {
        font-size: 1.3rem;
    }
    
    .menu-close-btn {
        width: 40px;
        height: 40px;
    }
    
    .menu-content {
        padding: 1.5rem;
        max-height: calc(90vh - 120px);
    }
    
    .menu-section {
        margin-bottom: 2rem;
    }
    
    .menu-section-title {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
        gap: 0.75rem;
    }
    
    .menu-section-title i {
        font-size: 1.2rem;
    }
    
    .menu-item {
        padding: 1rem 1.25rem;
        gap: 1rem;
        border-radius: 14px;
    }
    
    .menu-item-icon {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
        border-radius: 12px;
    }
    
    .menu-item-title {
        font-size: 1rem;
        margin-bottom: 0.375rem;
    }
    
    .menu-item-subtitle {
        font-size: 0.85rem;
    }
    
    .menu-item:hover {
        transform: translateX(-6px) translateY(-1px);
    }
}

@media (max-width: 480px) {
    .menu-popup {
        width: 98%;
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    .menu-header {
        padding: 1.25rem 1.25rem 1rem;
    }
    
    .menu-content {
        padding: 1.25rem;
        max-height: calc(95vh - 100px);
    }
    
    .menu-item {
        padding: 0.875rem 1rem;
        gap: 0.875rem;
    }
    
    .menu-item-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .menu-item-title {
        font-size: 0.95rem;
    }
    
    .menu-item-subtitle {
        font-size: 0.8rem;
    }
}
