/* ============================================
   AIvoy — Auth Modal & Profile Panel Styles
   ============================================ */

/* --- Auth Modal --- */
.auth-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}
.auth-modal--open { display: flex; }

.auth-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.auth-modal__content {
    position: relative;
    background: var(--bg-secondary, #0c0c1d);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 20px;
    padding: 40px;
    max-width: 420px;
    width: 90%;
    animation: slideUp 0.3s ease;
}

.auth-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted, #888);
    font-size: 20px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}
.auth-modal__close:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.auth-modal__header {
    text-align: center;
    margin-bottom: 28px;
}
.auth-modal__logo {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}
.auth-modal__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin: 0 0 8px;
}
.auth-modal__subtitle {
    font-size: 14px;
    color: var(--text-muted, #888);
    margin: 0;
    line-height: 1.4;
}

/* --- Auth Buttons --- */
.auth-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
}
.auth-btn--google {
    background: #fff;
    color: #333;
}
.auth-btn--google:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}
.auth-btn--primary {
    background: var(--gradient-primary, linear-gradient(135deg, #6366f1, #8b5cf6));
    color: white;
}
.auth-btn--primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* --- Divider --- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-muted, #888);
    font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border, rgba(255,255,255,0.08));
}

/* --- Auth Form --- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #ccc);
    margin-bottom: 6px;
}
.auth-field input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-tertiary, rgba(255,255,255,0.05));
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 10px;
    color: var(--text-primary, white);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.auth-field input:focus {
    outline: none;
    border-color: var(--primary, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.auth-error {
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
    font-size: 13px;
}
.auth-toggle {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted, #888);
}
.auth-toggle a {
    color: var(--primary, #6366f1);
    text-decoration: none;
    font-weight: 600;
}
.auth-toggle a:hover {
    text-decoration: underline;
}

/* --- Profile Panel (slide-in from right) --- */
.profile-panel {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
}
.profile-panel--open { display: block; }

.profile-panel__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}
.profile-panel__content {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 360px;
    max-width: 90%;
    background: var(--bg-secondary, #0c0c1d);
    border-left: 1px solid var(--border, rgba(255,255,255,0.08));
    padding: 24px;
    overflow-y: auto;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.profile-panel__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted, #888);
    font-size: 18px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}
.profile-panel__close:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.profile-panel__header {
    text-align: center;
    padding: 20px 0 24px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
    margin-bottom: 20px;
}
.profile-panel__avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--gradient-primary, linear-gradient(135deg, #6366f1, #8b5cf6));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 12px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}
.profile-panel__name {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text-primary, white);
}
.profile-panel__email {
    font-size: 13px;
    color: var(--text-muted, #888);
    margin: 0;
}

/* --- Profile Stats --- */
.profile-panel__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}
.profile-stat {
    text-align: center;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}
.profile-stat__value {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary, #6366f1);
}
.profile-stat__label {
    display: block;
    font-size: 11px;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

/* --- Profile Sections --- */
.profile-panel__section {
    margin-bottom: 20px;
}
.profile-panel__section h4 {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--text-primary, white);
}

.profile-panel__actions {
    display: flex;
    gap: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--border, rgba(255,255,255,0.08));
    flex-wrap: wrap;
}

/* --- User button logged state --- */
.btn-user--logged {
    background: var(--gradient-primary, linear-gradient(135deg, #6366f1, #8b5cf6)) !important;
    border-color: transparent !important;
    font-size: 16px !important;
}

/* --- Chat typing animation --- */
.chat-typing {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}
.chat-typing__dots {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
}
.chat-typing__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary, #6366f1);
    animation: typingBounce 1.4s ease-in-out infinite;
}
.chat-typing__dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* --- Day section animations --- */
.day-section {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Activity card --- */
.activity-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 8px;
    transition: all 0.2s;
    position: relative;
}
.activity-card:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}
.activity-card__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.activity-card__icon--see { background: rgba(99, 102, 241, 0.15); }
.activity-card__icon--eat { background: rgba(239, 68, 68, 0.15); }
.activity-card__icon--sleep { background: rgba(16, 185, 129, 0.15); }
.activity-card__icon--transport { background: rgba(245, 158, 11, 0.15); }

.activity-card__content { flex: 1; min-width: 0; }
.activity-card__name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary, white);
    margin-bottom: 2px;
}
.activity-card__desc {
    font-size: 12px;
    color: var(--text-muted, #888);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.activity-card__meta {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted, #888);
}
.activity-card__delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: none;
    border: none;
    color: var(--text-muted, #888);
    cursor: pointer;
    font-size: 11px;
    display: none;
    align-items: center;
    justify-content: center;
}
.activity-card:hover .activity-card__delete {
    display: flex;
}
.activity-card__delete:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* --- Day section header --- */
.day-section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.day-section__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary, #6366f1);
}
.day-section__date {
    font-size: 11px;
    color: var(--text-muted, #888);
}

/* --- Budget chip enhancements --- */
.budget-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    cursor: pointer;
    color: var(--text-primary, white);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}
.budget-chip:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}
.budget-chip__bar {
    width: 60px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.1);
    overflow: hidden;
}
.budget-chip__fill {
    height: 100%;
    border-radius: 2px;
    background: var(--success, #10b981);
    transition: width 0.5s ease;
}
.budget-chip__fill--warning { background: var(--warning, #f59e0b); }
.budget-chip__fill--danger { background: var(--error, #ef4444); }

/* --- Topbar transport buttons --- */
.topbar__transport {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.topbar__transport:hover {
    background: rgba(255,255,255,0.1);
}
.topbar__transport--active {
    background: var(--primary, #6366f1);
    border-color: var(--primary, #6366f1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

/* --- Chat specific styles for app --- */
.chat-panel__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.chat-panel__ai-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--gradient-primary, linear-gradient(135deg, #6366f1, #8b5cf6));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 13px;
    font-weight: 800;
}
.chat-panel__ai-info h3 {
    font-size: 14px;
    margin: 0;
}
.chat-panel__ai-status {
    font-size: 11px;
    color: var(--success, #10b981);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
.chat-msg {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-msg--user { flex-direction: row-reverse; }
.chat-msg__avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.chat-msg--ai .chat-msg__avatar {
    background: var(--gradient-primary, linear-gradient(135deg, #6366f1, #8b5cf6));
    color: white;
}
.chat-msg--user .chat-msg__avatar {
    background: rgba(255,255,255,0.1);
    color: var(--text-secondary, #ccc);
}
.chat-msg__bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
}
.chat-msg--ai .chat-msg__bubble {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text-primary, white);
}
.chat-msg--user .chat-msg__bubble {
    background: var(--primary, #6366f1);
    color: white;
    border-radius: 14px 14px 4px 14px;
}

/* --- Chat chips --- */
.chat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px;
}
.chat-chip {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary, #ccc);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.chat-chip:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary, #6366f1);
    color: white;
}

/* --- Chat input --- */
.chat-input {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.chat-input__form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 6px 6px 6px 14px;
    transition: border-color 0.2s;
}
.chat-input__form:focus-within {
    border-color: var(--primary, #6366f1);
}
.chat-input__field {
    flex: 1;
    border: none;
    background: none;
    color: var(--text-primary, white);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    padding: 6px 0;
    max-height: 120px;
}
.chat-input__field::placeholder {
    color: var(--text-muted, #888);
}
.chat-input__send {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: var(--gradient-primary, linear-gradient(135deg, #6366f1, #8b5cf6));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.chat-input__send:hover {
    transform: scale(1.05);
}

/* --- Topbar --- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--bg-secondary, #0c0c1d);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    grid-column: 1 / -1;
    gap: 16px;
}
.topbar__left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.topbar__trip-name {
    background: none;
    border: 1px solid transparent;
    color: var(--text-primary, white);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}
.topbar__trip-name:hover,
.topbar__trip-name:focus {
    border-color: rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    outline: none;
}
.topbar__center {
    display: flex;
    gap: 4px;
}
.topbar__right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Itinerary panel --- */
.itinerary-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.itinerary-panel__header h3 {
    font-size: 16px;
    margin: 0;
}
.itinerary-panel__summary {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted, #888);
}
.itinerary-days {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}

/* --- Empty state --- */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted, #888);
}
.empty-state__icon { font-size: 48px; margin-bottom: 12px; }
.empty-state__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary, #ccc);
    margin: 0 0 8px;
}
.empty-state__desc {
    font-size: 13px;
    margin: 0;
    line-height: 1.4;
}

/* --- Reveal animation --- */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal--visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- General animation --- */
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(168, 85, 247, 0); }
}

/* ============================================
   Segmentos de distancia entre paradas
   ============================================ */
.route-segment {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
    margin: 2px 0 2px 18px;
}
.route-segment__line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}
.route-segment__info {
    display: flex;
    gap: 8px;
    font-size: 10px;
    color: var(--text-muted, #888);
    white-space: nowrap;
    padding: 2px 8px;
    background: rgba(99, 102, 241, 0.06);
    border-radius: 10px;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

/* ============================================
   Barra de resumen del viaje
   ============================================ */
.trip-summary-bar {
    padding: 10px 12px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 12px;
    margin: 8px 12px 4px;
    animation: fadeInUp 0.4s ease;
}
.trip-summary-bar__stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
}
.trip-summary-bar__stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.trip-summary-bar__value {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary, white);
}
.trip-summary-bar__label {
    font-size: 10px;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.trip-summary-bar__breakdown {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.trip-summary-bar__cat {
    font-size: 11px;
    color: var(--cat-color, #888);
    font-weight: 600;
}

/* ============================================
   Toast de feedback de acciones
   ============================================ */
.action-feedback {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(16, 185, 129, 0.95);
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    z-index: 20000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}
.action-feedback--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

