/* EV Battery Health Monitor - Premium Dark Theme Landing Page Styles */

/* CSS Custom Properties - Professional blue with visible borders */
:root {
    --bg-main: #0f172a;
    --bg-panel: #1a2142;
    --border-color: #374151;
    --accent-primary: #36c2b4;
    --accent-hover: #2aa399;
    --btn-secondary: #475569;
    --btn-secondary-hover: #64748b;
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --status-connected: #22c55e;
}

/* Dark background with exact reference colors */
body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Panel styling with exact reference colors */
.glass-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    backdrop-filter: blur(20px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.4),
        0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-primary);
}

/* Feature cards with exact reference colors */
.feature-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-primary);
}

/* Two-toned gradient text for main title */
.gradient-text {
    background: linear-gradient(90deg, #22c55e 0%, #36c2b4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

/* Primary button styling */
.btn-primary {
    background-color: #2563eb;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
}

/* Hero background with dark gradient */
.hero-bg {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 25%, #334155 50%, #1e293b 75%, #0f172a 100%);
}

/* Navigation styling for dark theme */
nav {
    backdrop-filter: blur(20px);
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid rgba(71, 85, 105, 0.2);
}

/* Stat cards with exact reference colors */
.stat-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-primary);
}

/* Dashboard preview with exact reference styling */
.dashboard-preview {
    background-color: var(--bg-panel);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    backdrop-filter: blur(25px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* Progress bars with exact accent color */
.progress-bar {
    background-color: var(--accent-primary);
    border-radius: 0.5rem;
    position: relative;
    overflow: hidden;
}

/* Logo container mobile adjustments */
@media (max-width: 768px) {
    /* Increase body padding to prevent header cutoff */
    body[style*="padding-top"] {
        padding-top: 26rem !important;
    }

    /* Expand container to accommodate larger scaled images */
    .header-container-wrapper > div[style*="position: absolute"][style*="top: -11.5rem"],
    .header-container-wrapper > div[style*="position: absolute"][style*="top: -12.5rem"] {
        top: -24rem !important;
        height: 26rem !important;
        padding-top: 1rem !important;
        padding-bottom: 2rem !important;
        overflow: visible !important;
    }

    /* Zoom/scale eelPlug logo larger for mobile visibility */
    .header-container-wrapper > div[style*="position: absolute"] img[src="eelPlug_Offiicial.png"] {
        height: 4rem !important;
        transform: scale(1.1);
        margin-bottom: 1rem !important;
        margin-top: 0 !important;
    }

    /* Zoom/scale banner2.png much larger for mobile visibility */
    .header-container-wrapper > div[style*="position: absolute"] div[style*="inline-block"] {
        top: 14rem !important;
        transform: translate(-50%, -50%) scale(1.9) !important;
    }

    .header-container-wrapper > div[style*="position: absolute"] div[style*="inline-block"] img[src="Banner2.png"] {
        max-height: 14rem !important;
    }
}

/* iPhone SE specific adjustments */
@media (max-width: 480px) {
    /* Increase body padding for iPhone SE */
    body[style*="padding-top"] {
        padding-top: 24rem !important;
    }

    /* Expand container for very small screens */
    .header-container-wrapper > div[style*="position: absolute"][style*="top: -11.5rem"],
    .header-container-wrapper > div[style*="position: absolute"][style*="top: -12.5rem"] {
        top: -22rem !important;
        height: 24rem !important;
        padding-top: 1rem !important;
        padding-bottom: 2rem !important;
        overflow: visible !important;
    }

    /* Zoom/scale eelPlug logo for iPhone SE */
    .header-container-wrapper > div[style*="position: absolute"] img[src="eelPlug_Offiicial.png"] {
        height: 3.5rem !important;
        transform: scale(1.1);
        margin-bottom: 1rem !important;
        margin-top: 0 !important;
    }

    /* Zoom/scale banner2.png for iPhone SE */
    .header-container-wrapper > div[style*="position: absolute"] div[style*="inline-block"] {
        top: 12.5rem !important;
        transform: translate(-50%, -50%) scale(1.8) !important;
    }

    .header-container-wrapper > div[style*="position: absolute"] div[style*="inline-block"] img[src="Banner2.png"] {
        max-height: 12rem !important;
    }
}

/* Responsive design adjustments */
@media (max-width: 768px) {
    /* CRITICAL: Fix horizontal overflow and cutoff */
    html {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }

    body {
        overflow-x: hidden !important;
        width: 100vw !important;
        max-width: 100% !important;
        margin: 0;
        padding: 0;
    }

    /* Fix all containers */
    * {
        box-sizing: border-box !important;
    }

    /* General mobile adjustments */
    .max-w-7xl {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Ensure all content containers fit */
    .glass-card, .feature-card, .stat-card, .dashboard-preview {
        padding: 1.5rem;
        border-width: 1px;
        margin-bottom: 1.5rem;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .hero-bg {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .gradient-text {
        font-size: 1.5rem;
        line-height: 1.2;
    }

    /* Brand logo mobile positioning - on top of border */
    .brand-logo-absolute {
        height: 2.5rem;
        top: -1.75rem;
        left: 0.75rem;
    }

    /* Header section mobile - extend right border for status button */
    .header-section {
        padding: 1rem 6rem 1rem 1rem;
        margin-bottom: 1rem;
        width: 100%;
        max-width: 100%;
    }

    .header-section .max-w-5xl {
        padding-left: 1rem;
        padding-right: 6rem;
        width: 100%;
        max-width: 100%;
    }

    /* Vehicle info mobile */
    .vehicle-info {
        margin-bottom: 1rem;
    }

    .vehicle-info h1 {
        font-size: 1.25rem;
    }

    /* Status positioning mobile - override inline styles and move down */
    .status {
        position: relative !important;
        margin-bottom: 1rem !important;
        transform: none !important;
        margin-top: 2rem !important;
        text-align: left !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .status .flex {
        transform: translateY(35px) !important;
        justify-content: flex-start !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Connected button now has room within extended header */
    .status span {
        white-space: nowrap !important;
        display: inline-block !important;
    }

    /* Force connected button to stay within bounds */
    .status .flex .px-3 {
        margin-right: 0.5rem !important;
        flex-shrink: 1 !important;
    }

    /* Divider mobile - ensure full width span */
    .h-px {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        left: 0;
        right: 0;
    }

    /* Fix the specific header divider - extend endpoints to mobile card boundaries */
    .header-section .h-px.bg-gray-500 {
        width: calc(100% + 35rem) !important;
        margin-left: -1.5rem !important;
        margin-right: -33.5rem !important;
        margin-top: 1.5rem !important;
        margin-bottom: 1.5rem !important;
        position: relative;
        left: 0;
        right: 0;
    }

    /* More specific targeting to override inline styles - extend endpoints */
    .header-section div[style*="width: calc(100vw"],
    .header-section div[style*="width: calc(100vw - 225px)"],
    .header-section div[style*="margin-left: -120px"],
    div.header-section div[style],
    .header-section > div > div[style] {
        width: calc(100% + 150rem) !important;
        margin-left: -1.5rem !important;
        margin-right: -148.5rem !important;
        margin-top: 1.5rem !important;
        margin-bottom: 1.5rem !important;
        position: relative !important;
        left: 0 !important;
        right: 0 !important;
        box-sizing: border-box !important;
    }

    /* iPhone image mobile */
    .header-section img {
        width: 120px !important;
        height: auto;
        margin: 1rem auto;
        display: block;
    }

    /* Store buttons mobile */
    .header-section > div:last-child {
        margin-top: 3rem !important;
        margin-left: 0 !important;
        transform: none !important;
        justify-content: center !important;
        flex-direction: column;
        gap: 0.75rem;
    }

    .header-section > div:last-child > div {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    /* Grid layout mobile - Fix main content cutoff */
    .lg\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }

    /* Ensure main content container doesn't overflow */
    .grid.lg\\:grid-cols-2 {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Fix individual content sections */
    .grid.lg\\:grid-cols-2 > div {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    /* Feature grid mobile */
    .md\\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .feature-card {
        padding: 1rem;
    }

    /* Dashboard preview mobile - Fix right side cutoff */
    .dashboard-preview {
        padding: 1.5rem;
        margin-top: 2rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .dashboard-preview img {
        width: 200px !important;
        height: auto;
        max-width: 100%;
    }

    .dashboard-preview .grid {
        gap: 1rem;
        width: 100%;
        max-width: 100%;
    }

    /* Fix right side sticky positioning on mobile */
    .lg\\:sticky {
        position: static !important;
    }

    /* Battery status mobile */
    .battery-circle {
        width: 100px !important;
        height: 100px !important;
    }

    .battery-circle .text-3xl {
        font-size: 1.5rem;
    }

    /* Stat cards mobile */
    .stat-card {
        padding: 1rem;
    }

    /* Vehicle details grid mobile */
    .dashboard-preview .grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
        width: 100%;
        max-width: 100%;
    }

    /* Fix any remaining grid issues */
    .grid-cols-2, .grid, .flex {
        grid-template-columns: 1fr !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }

    /* Prevent any element from causing overflow */
    div, section, article, main, header, footer {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Text sizing mobile */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
    h4 { font-size: 1rem; }

    /* Button sizing mobile */
    .btn-primary {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
        width: 100%;
        text-align: center;
    }

    /* Footer mobile */
    footer {
        padding: 1.5rem 1rem;
        text-align: center;
    }
}

/* Small mobile devices - iPhone SE and similar */
@media (max-width: 480px) {
    /* Ensure no horizontal overflow */
    body {
        overflow-x: hidden;
        width: 100vw;
        max-width: 100%;
    }

    .max-w-7xl {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        width: 100%;
        max-width: 100%;
    }

    .glass-card {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .gradient-text {
        font-size: 1.25rem;
    }

    /* Brand logo iPhone SE positioning - on top of border */
    .brand-logo-absolute {
        height: 2rem;
        top: -1.5rem;
        left: 0.5rem;
    }

    .header-section {
        padding: 0.75rem;
        width: 100%;
        max-width: 100%;
    }

    /* Extend divider endpoints to iPhone SE card boundaries */
    .header-section .h-px.bg-gray-500,
    .header-section div[style*="width: calc(100vw"] {
        width: calc(100% + 25rem) !important;
        margin-left: -1rem !important;
        margin-right: -24rem !important;
        margin-top: 1rem !important;
        margin-bottom: 1rem !important;
    }

    .header-section img {
        width: 100px !important;
    }

    .dashboard-preview {
        width: 100%;
        max-width: 100%;
        padding: 1rem;
        box-sizing: border-box;
    }

    .dashboard-preview img {
        width: 150px !important;
        max-width: 100%;
    }

    .feature-card {
        padding: 0.75rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .stat-card {
        padding: 0.75rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Ensure all grids are single column on very small screens */
    .grid {
        grid-template-columns: 1fr !important;
        width: 100%;
        max-width: 100%;
    }

    /* Fix any text overflow */
    h1, h2, h3, h4, h5, h6, p, div {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Icon containers with exact reference colors */
.icon-container {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
}

.icon-container:hover {
    background-color: var(--btn-secondary);
    border-color: var(--accent-primary);
}

/* Footer styling for dark theme */
footer {
    background: rgba(15, 23, 42, 0.8);
    border-top: 1px solid rgba(71, 85, 105, 0.2);
}

/* Smooth animations */
* {
    scroll-behavior: smooth;
}

/* Custom focus states for accessibility */
button:focus,
a:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Loading states for buttons */
.btn-loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Text utility classes with exact reference colors */
.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-tertiary {
    color: var(--text-tertiary);
}

.bg-primary {
    background-color: var(--accent-primary);
}

.bg-secondary {
    background-color: var(--bg-panel);
}

.border-primary {
    border-color: var(--accent-primary);
}

/* Enhanced visual hierarchy with exact reference colors */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
}

p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Health status colors */
.health-excellent {
    color: var(--accent-primary);
    font-weight: 600;
}

.health-good {
    color: var(--status-connected);
    font-weight: 600;
}

.health-warning {
    color: #f59e0b;
    font-weight: 600;
}

.health-critical {
    color: #ef4444;
    font-weight: 600;
}

/* Interactive elements with subtle glow */
.interactive:hover {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* Live indicator */
.live-indicator {
    background-color: var(--status-connected);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--btn-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--btn-secondary-hover);
}

/* Header container styling */
.header-container {
    background-color: var(--bg-panel);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 2rem 3rem;
}

.header-container:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-primary);
}

/* Secondary button styling from reference */
.button-secondary {
    background-color: var(--btn-secondary);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.button-secondary:hover {
    background-color: var(--btn-secondary-hover);
}

/* Vehicle info styling */
.vehicle-info p {
    margin: 0.2rem 0;
}

.vehicle-info .miles {
    color: var(--text-secondary);
}

.vehicle-info .vin {
    color: var(--text-tertiary);
}

/* Status indicator */
.status {
    color: var(--status-connected);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Header container wrapper for logo positioning */
.header-container-wrapper {
    position: relative;
    margin-top: 2rem;
}

/* Brand logo absolute positioning - on top of header border */
.brand-logo-absolute {
    position: absolute;
    top: 2rem;
    left: -8.5rem;
    height: 5rem;
    width: auto;
    filter: brightness(1.1);
    z-index: 10;
    background-color: var(--bg-main);
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
}

/* Header section with full border */
.header-section {
    background-color: var(--bg-main);
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    margin-bottom: 2rem;
    position: relative;
}

/* Universal divider full-width rule - absolute positioning to span card width */
.header-section .h-px,
.header-section div[class*="h-px"],
.header-section .h-px.bg-gray-500,
.header-section div.h-px,
div.header-section .h-px,
header.header-section .h-px,
.header-section > div > .h-px {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    box-sizing: border-box !important;
}

/* Enhanced shimmer effect for progress bars */
@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

/* Store buttons positioning - move up without affecting layout flow */
.store-buttons-position {
    transform: translateY(-15rem) translateX(3.5rem);
}