/* --- RESET Y ESTILOS GLOBALES --- */
:root {
    --green-primary: #16a34a;
    --green-secondary: #dcfce7;
    --dark-primary: #1f2937;
    --gray-light: #f3f4f6;
    --gray-medium: #6b7280;
    --gray-dark: #4b5563;
    --white: #ffffff;
    --red: #ef4444;
    --red-light: #fee2e2;
    --yellow: #f59e0b;
    --orange: #f97316;
    --blue: #3b82f6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--gray-light);
    color: var(--dark-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- ESTRUCTURA DE LA APP --- */
.app-shell {
    position: relative;
    max-width: 448px; /* Equivalente a max-w-md de Tailwind */
    height: 100vh;
    margin: 0 auto;
    background-color: var(--white);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.app-main {
    flex-grow: 1;
    overflow-y: auto;
    padding-bottom: 4rem; /* 64px, altura de la barra de navegación */
}

.screen {
    display: none;
    height: 100%;
    width: 100%;
    animation: fadeIn 0.3s ease-in-out;
}

.screen.active {
    display: block;
}

.screen-content {
    padding: 1.5rem; /* 24px */
}

.subtitle {
    color: var(--gray-medium);
    margin-bottom: 2rem;
}

/* --- BOTONES --- */
.btn {
    width: 100%;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem; /* 12px */
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn:hover {
    transform: scale(1.03);
}

.btn-primary {
    background-color: var(--green-primary);
    color: var(--white);
}
.btn-primary:hover {
    background-color: #15803d;
}

.btn-secondary {
    background-color: var(--white);
    color: var(--green-primary);
    border: 1px solid var(--green-primary);
}
.btn-secondary:hover {
    background-color: var(--green-secondary);
}

.btn-dark {
    background-color: var(--dark-primary);
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: 9999px;
}
.btn-dark:hover {
    background-color: #000;
}

.btn-danger {
    background-color: var(--red-light);
    color: var(--red);
}
.btn-danger:hover {
    background-color: #fecaca;
}

/* --- PANTALLA DE INICIO --- */
#screen-home {
    background: linear-gradient(to bottom, #f0fdf4, #a7f3d0);
}
.home-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 2rem;
}
.home-logo {
    margin-bottom: 1rem;
    color: var(--green-primary);
}
.home-content h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--dark-primary);
    margin-bottom: 0.5rem;
}
.home-content p {
    font-size: 1.125rem;
    color: var(--gray-dark);
    margin-bottom: 3rem;
}
.home-buttons {
    width: 100%;
    max-width: 384px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* --- PANTALLA DE MAPA --- */
#screen-map {
    position: relative;
    overflow: hidden;
}
.map-background {
    position: absolute;
    inset: 0;
    background-color: #dcfce7;
    display: flex;
    align-items: center;
    justify-content: center;
}
.map-background h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--green-primary);
    opacity: 0.4;
    transform: rotate(-12deg);
    user-select: none;
}
.vehicle-icons-container {
    position: relative;
    width: 100%;
    height: 100%;
}
.vehicle-icon {
    position: absolute;
    background-color: var(--white);
    padding: 0.5rem;
    border-radius: 9999px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    cursor: pointer;
    transform: translate(-50%, -50%);
    z-index: 10;
}
.vehicle-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}
.electric-bolt {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 0.75rem;
    height: 0.75rem;
    color: var(--yellow);
    background-color: var(--white);
    border-radius: 9999px;
}
#calculate-route-button-container {
    position: absolute;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 100%;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
}
.vehicle-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 91.66%;
    max-width: 384px;
    background-color: var(--white);
    padding: 1.25rem;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    z-index: 20;
    animation: fadeInPopup 0.2s ease-out forwards;
}
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.popup-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}
.popup-header p {
    color: var(--gray-medium);
}
.popup-close-btn {
    font-size: 1.5rem;
    line-height: 1;
    color: #9ca3af;
    background: none;
    border: none;
    cursor: pointer;
}
.popup-battery {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.popup-battery span {
    color: var(--green-primary);
    font-weight: 600;
}
.popup-reserve-btn {
    margin-top: 1.25rem;
    background-color: var(--green-primary);
    color: var(--white);
    font-weight: 700;
    padding: 0.75rem;
    border-radius: 0.75rem;
    width: 100%;
    border: none;
    cursor: pointer;
}

/* --- TARJETAS (ECOPOINTS, COMMUNITY) --- */
.cards-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.card {
    background-color: var(--white);
    padding: 1.25rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.card-icon {
    padding: 0.75rem;
    border-radius: 9999px;
}
.card-icon svg {
    width: 2rem;
    height: 2rem;
}
.card-info p:first-child {
    color: var(--gray-medium);
}
.card-info p:last-child {
    font-size: 1.5rem;
    font-weight: 700;
}
.testimonial-card {
    padding: 1.25rem;
}
.testimonial-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}
.testimonial-header img {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    margin-right: 1rem;
}
.testimonial-header span {
    font-weight: 700;
}
.testimonial-comment {
    color: var(--gray-dark);
    font-style: italic;
}


/* --- PANTALLA DE PERFIL --- */
.profile-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.profile-avatar {
    width: 8rem;
    height: 8rem;
    border-radius: 9999px;
    margin-bottom: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}
.profile-content h2 {
    font-size: 1.875rem;
    font-weight: 700;
}
.profile-stats-container {
    width: 100%;
    max-width: 384px;
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06);
    margin-top: 2rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.stat-item span:first-child {
    color: var(--gray-dark);
}
.stat-item span:last-child {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--green-primary);
}
.profile-stats-container hr {
    border: none;
    border-top: 1px solid var(--gray-light);
}

/* --- NAVEGACIÓN INFERIOR --- */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--white);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 4rem; /* 64px */
    z-index: 20;
}
.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 25%;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af; /* gray-400 */
    transition: color 0.2s ease-in-out;
}
.nav-btn.active {
    color: var(--green-primary);
}
.nav-btn span {
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

/* --- MODAL --- */
.modal-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: flex-end;
    z-index: 30;
}
.modal-content {
    background-color: var(--white);
    width: 100%;
    border-top-left-radius: 1.5rem;
    border-top-right-radius: 1.5rem;
    padding: 1.5rem;
    animation: slideUp 0.3s ease-out forwards;
}
.modal-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}
.form-group {
    margin-bottom: 1rem;
}
.form-group input {
    width: 100%;
    background-color: var(--gray-light);
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
}
.form-group input:focus {
    outline: none;
    border-color: var(--green-primary);
}
.modal-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}
.modal-actions .btn {
    flex: 1;
}

/* --- UTILIDADES Y ANIMACIONES --- */
.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInPopup {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}