/**
 * InDriver Perfil Pasajero v1.0
 * Estilos para el panel de pasajero
 */

/* Reset y base */
.ipp-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
}

/* Cabecera del perfil */
.ipp-header {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border-radius: 18px;
    padding: 30px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(46, 204, 113, 0.2);
    color: white;
}

.ipp-avatar-section {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.ipp-avatar-wrapper {
    position: relative;
}

.ipp-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.ipp-avatar:hover {
    transform: scale(1.05);
}

.ipp-avatar-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: white;
    color: #2ecc71;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.ipp-avatar-upload-btn:hover {
    background: #2ecc71;
    color: white;
    transform: scale(1.1);
}

.ipp-user-info {
    flex: 1;
    min-width: 200px;
}

.ipp-greeting {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 700;
    color: white;
}

.ipp-email {
    margin: 0 0 6px 0;
    font-size: 15px;
    opacity: 0.95;
    font-weight: 500;
}

.ipp-phone,
.ipp-address {
    margin: 4px 0;
    font-size: 14px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ipp-phone svg,
.ipp-address svg {
    opacity: 0.8;
}

/* Acciones rápidas */
.ipp-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.ipp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: none;
    cursor: pointer;
}

.ipp-btn svg {
    stroke-width: 2.5;
}

.ipp-btn-primary {
    background: #2ecc71;
    color: white;
}

.ipp-btn-primary:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(46, 204, 113, 0.3);
}

.ipp-btn-emergency {
    background: #e74c3c;
    color: white;
}

.ipp-btn-emergency:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.3);
}

.ipp-btn-support {
    background: #3498db;
    color: white;
}

.ipp-btn-support:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.3);
}

.ipp-btn-logout {
    background: #95a5a6;
    color: white;
}

.ipp-btn-logout:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(149, 165, 166, 0.3);
}

/* Toggle mantenerme conectado */
.ipp-stay-logged-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.ipp-toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.ipp-toggle-container input[type="checkbox"] {
    display: none;
}

.ipp-toggle-slider {
    position: relative;
    width: 52px;
    height: 28px;
    background: #ddd;
    border-radius: 28px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.ipp-toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ipp-toggle-container input[type="checkbox"]:checked + .ipp-toggle-slider {
    background: #2ecc71;
}

.ipp-toggle-container input[type="checkbox"]:checked + .ipp-toggle-slider::before {
    transform: translateX(24px);
}

.ipp-toggle-label {
    font-size: 15px;
    font-weight: 500;
    color: #2c3e50;
}

/* Sección de viajes */
.ipp-trips-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.ipp-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
}

.ipp-section-title svg {
    color: #2ecc71;
    stroke-width: 2.5;
}

/* Sin viajes */
.ipp-no-trips {
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
}

.ipp-no-trips svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.ipp-no-trips p {
    margin: 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #7f8c8d;
}

.ipp-no-trips small {
    font-size: 14px;
}

/* Lista de viajes */
.ipp-trips-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ipp-trip-card {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.ipp-trip-card:hover {
    border-color: #2ecc71;
    box-shadow: 0 4px 16px rgba(46, 204, 113, 0.15);
    transform: translateY(-2px);
}

.ipp-trip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e9ecef;
}

.ipp-trip-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 500;
}

.ipp-trip-date svg {
    stroke-width: 2;
}

.ipp-trip-total {
    font-size: 18px;
    font-weight: 700;
    color: #2ecc71;
}

/* Ruta del viaje */
.ipp-trip-route {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.ipp-trip-location {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.ipp-location-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.ipp-location-icon.ipp-pickup {
    background: #e3f2fd;
    color: #2196f3;
}

.ipp-location-icon.ipp-destination {
    background: #fce4ec;
    color: #e91e63;
}

.ipp-location-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ipp-location-label {
    font-size: 12px;
    font-weight: 600;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ipp-location-address {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    line-height: 1.4;
}

.ipp-trip-line {
    width: 2px;
    height: 16px;
    background: linear-gradient(to bottom, #2196f3, #e91e63);
    margin-left: 13px;
    opacity: 0.3;
}

/* Información del conductor */
.ipp-trip-driver {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #dee2e6;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #6c757d;
}

.ipp-trip-driver span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ipp-trip-driver strong {
    color: #495057;
}

/* Responsive */
@media (max-width: 768px) {
    .ipp-dashboard {
        padding: 12px;
    }
    
    .ipp-header {
        padding: 20px;
    }
    
    .ipp-avatar-section {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .ipp-greeting {
        font-size: 24px;
    }
    
    .ipp-quick-actions {
        grid-template-columns: 1fr 1fr;
    }
    
    .ipp-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .ipp-trip-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .ipp-quick-actions {
        grid-template-columns: 1fr;
    }
    
    .ipp-avatar {
        width: 72px;
        height: 72px;
    }
}

/* Animaciones de carga */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ipp-trip-card {
    animation: fadeIn 0.4s ease forwards;
}

.ipp-trip-card:nth-child(1) { animation-delay: 0.05s; }
.ipp-trip-card:nth-child(2) { animation-delay: 0.1s; }
.ipp-trip-card:nth-child(3) { animation-delay: 0.15s; }
.ipp-trip-card:nth-child(4) { animation-delay: 0.2s; }
.ipp-trip-card:nth-child(5) { animation-delay: 0.25s; }

/* Notificaciones */
.ipp-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

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

.ipp-notification.success {
    border-left: 4px solid #2ecc71;
}

.ipp-notification.error {
    border-left: 4px solid #e74c3c;
}

.ipp-notification-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ipp-notification.success .ipp-notification-icon {
    background: #2ecc71;
    color: white;
}

.ipp-notification.error .ipp-notification-icon {
    background: #e74c3c;
    color: white;
}

.ipp-notification-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
}

/* Ocultar elementos de WooCommerce por defecto */
.woocommerce-MyAccount-navigation {
    display: none !important;
}

/* Loading state */
.ipp-loading {
    opacity: 0.6;
    pointer-events: none;
}

.ipp-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid #2ecc71;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
