/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #e5e7eb;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Fondo del auto */
.car-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/bg_car.webp');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    z-index: -1;
    opacity: 0.9;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.car-background.changing {
    opacity: 0.7;
    transform: scale(1.05);
    filter: blur(1px);
}

/* Clase glassmorphism mejorada */
.glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

/* Dashboard container */
.dashboard {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    padding: 20px;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    height: 70px;
}

.header-left .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 18px;
    color: #1f2937;
}

.logo i {
    font-size: 24px;
    color: #000;
    background: #000;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-center .nav-pills {
    display: flex;
    gap: 4px;
    background: #d1d5db;
    padding: 4px;
    border-radius: 25px;
    position: relative;
    overflow: hidden;
}

.nav-pills::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(33.333% - 2px);
    height: calc(100% - 8px);
    background: #374151;
    border-radius: 20px;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1;
    transform: translateX(0);
}

.nav-pills.comprar::before {
    transform: translateX(100%);
}

.nav-pills.vender::before {
    transform: translateX(200%);
}

.nav-pill {
    padding: 12px 24px;
    border: none;
    border-radius: 20px;
    background: transparent;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    position: relative;
    z-index: 2;
    flex: 1;
    text-align: center;
}

.nav-pill.active {
    color: white;
}

.nav-pill:hover:not(.active) {
    color: #374151;
}

.header-right .location-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.location-selector:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: start;
}

/* Left Sidebar */
.sidebar-left {
    position: sticky;
    top: 20px;
}

.sidebar-icons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.sidebar-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #9ca3af;
    font-size: 18px;
}

.sidebar-icon:hover,
.sidebar-icon.active {
    background: rgba(156, 163, 175, 0.2);
    color: #374151;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: flex-start;
    padding-top: 40px;
}

.hero-content {
    position: relative;
    width: 100%;
}

.back-arrow {
    position: absolute;
    left: 0;
    top: 0;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.3s ease;
}

.back-arrow:hover {
    background: rgba(255, 255, 255, 1);
    color: #374151;
}

.hero-text {
    margin-left: 80px;
    max-width: 400px;
}

.hero-text h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.1;
}

.hero-text p {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 32px;
    font-weight: 400;
}

.options-buttons {
    display: flex;
    gap: 12px;
}

.option-btn {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    color: #6b7280;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.option-btn.active {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.option-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 1);
    color: #374151;
}

/* AI Assistant Panel */
.ai-assistant {
    width: 340px;
    padding: 24px;
    position: sticky;
    top: 20px;
    height: fit-content;
}

.ai-header {
    position: relative;
    margin-bottom: 20px;
}

.ai-header h3 {
    color: #1f2937;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 1.1rem;
}

.ai-header p {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0;
}

.close-btn {
    position: absolute;
    right: 0;
    top: 0;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(156, 163, 175, 0.1);
    color: #6b7280;
}

.ai-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.ai-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-card:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.ai-card i {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.ai-card-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ai-card-content span {
    color: #374151;
    font-weight: 500;
    font-size: 0.9rem;
}

.ai-card-content small {
    color: #9ca3af;
    font-size: 0.8rem;
}

.ai-suggestion {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid #10b981;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-suggestion p {
    color: #374151;
    font-size: 0.9rem;
    margin: 0;
}

.ai-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.input-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #374151;
}

.send-btn {
    flex: 1;
    height: 40px;
    background: #10b981;
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.send-btn:hover {
    background: #059669;
}

/* Bottom Widgets */
.bottom-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.widget {
    padding: 20px;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.widget-header h4 {
    color: #1f2937;
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
}

.widget-header i {
    color: #9ca3af;
    cursor: pointer;
    font-size: 14px;
}

.widget-subtitle {
    color: #6b7280;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

/* My Location Widget */
.location-map {
    position: relative;
    height: 120px;
    background: linear-gradient(135deg, #e0f2fe 0%, #b3e5fc 50%, #81d4fa 100%);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.location-map:hover {
    transform: scale(1.02);
}

.map-placeholder {
    position: relative;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="8" height="8" patternUnits="userSpaceOnUse"><path d="M 8 0 L 0 0 0 8" fill="none" stroke="%23ffffff" stroke-width="0.3" opacity="0.3"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>') repeat;
}

.map-streets {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(45deg, transparent 48%, rgba(255,255,255,0.4) 49%, rgba(255,255,255,0.4) 51%, transparent 52%),
        linear-gradient(-45deg, transparent 48%, rgba(255,255,255,0.3) 49%, rgba(255,255,255,0.3) 51%, transparent 52%);
    background-size: 30px 30px, 25px 25px;
}

.map-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: #10b981;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    animation: pulse 2s infinite;
}

.map-pin::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    width: 30px;
    height: 30px;
    border: 2px solid #10b981;
    border-radius: 50%;
    opacity: 0.3;
    animation: ripple 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0.8);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.location-status {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(16, 185, 129, 0.9);
    color: white;
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
}

/* Date Widget */
.date-widget {
    text-align: center;
}

.date-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.date-navigation {
    color: #9ca3af;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.date-navigation:hover {
    color: #6b7280;
}

.date-main {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.day {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.month {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 600;
}

.time {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-control-group {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-arrows {
    position: absolute;
    top: -20px;
    right: -15px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.time-control-group:hover .time-arrows {
    opacity: 1;
}

.time-up, .time-down {
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    transition: all 0.3s ease;
}

.time-up:hover, .time-down:hover {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    transform: scale(1.1);
}

.time-separator {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 4px;
}

.time-large {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
    min-width: 60px;
    text-align: center;
}

.time-period {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 600;
    margin-top: 8px;
}

/* Payment Widget */
.payment-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-visual {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #374151;
    font-weight: 500;
}

.card-visual i {
    font-size: 20px;
    color: #6b7280;
}

.card-number {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 600;
}

.card-status {
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
}

/* Sidebar derecho para elementos adicionales */
.sidebar-right {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 10;
}

.sidebar-right .sidebar-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.3s ease;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: auto 1fr;
    }
    
    .ai-assistant {
        display: none;
    }
    
    .hero-text h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .dashboard {
        padding: 10px;
        gap: 15px;
    }
    
    .header {
        flex-direction: column;
        gap: 16px;
        height: auto;
        padding: 20px;
    }
    
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar-left {
        position: relative;
    }
    
    .sidebar-icons {
        flex-direction: row;
        justify-content: center;
        padding: 12px 20px;
    }
    
    .bottom-widgets {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .hero-text {
        margin-left: 0;
        text-align: center;
    }
    
    .hero-text h1 {
        font-size: 2rem;
    }
    
    .back-arrow {
        position: relative;
        margin-bottom: 20px;
        width: 100%;
        justify-content: flex-start;
    }
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard > * {
    animation: fadeInUp 0.6s ease-out;
}

.dashboard > *:nth-child(2) {
    animation-delay: 0.1s;
}

.dashboard > *:nth-child(3) {
    animation-delay: 0.2s;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.5);
}