/**
 * Componentes reutilizables de la aplicación
 */

/* Tarjeta de cultivo */
.crop-card {
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.crop-card:hover {
    border-left-color: var(--dark-green);
}

.crop-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.crop-status.germination {
    background-color: #fff3cd;
    color: #856404;
}

.crop-status.growth {
    background-color: #d1ecf1;
    color: #0c5460;
}

.crop-status.flowering {
    background-color: #f8d7da;
    color: #721c24;
}

.crop-status.fruiting {
    background-color: #d4edda;
    color: #155724;
}

/* Tarjeta de diagnóstico */
.diagnosis-result {
    padding: 1.5rem;
    border-radius: var(--border-radius);
    background-color: white;
    margin-bottom: 1rem;
}

.confidence-bar {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffc107 0%, #28a745 100%);
    transition: width 0.6s ease;
}

.confidence-high {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

.confidence-medium {
    background: linear-gradient(90deg, #ffc107 0%, #fd7e14 100%);
}

.confidence-low {
    background: linear-gradient(90deg, #dc3545 0%, #e83e8c 100%);
}

/* Visor de imagen */
.image-preview {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.image-preview-overlay {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.5rem;
}

/* Input de archivo personalizado */
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
}

.file-input-label {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.file-input-label:hover {
    background-color: var(--dark-green);
}

.file-input-label i {
    margin-right: 0.5rem;
}

/* Chat bubble */
.chat-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.chat-message {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-bubble {
    max-width: 70%;
    padding: 1rem;
    border-radius: 1rem;
    position: relative;
}

.chat-bubble.user {
    background-color: var(--primary-color);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.chat-bubble.bot {
    background-color: #f1f3f4;
    color: var(--text-primary);
    border-bottom-left-radius: 0.25rem;
}

.chat-timestamp {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin: 0 0.5rem;
}

.chat-avatar.user {
    background-color: var(--accent-color);
    color: white;
}

.chat-avatar.bot {
    background-color: var(--secondary-color);
    color: white;
}

/* Typing indicator */
.typing-indicator {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 0.5rem;
}

.typing-indicator span,
.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #999;
    display: inline-block;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2),
.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3),
.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Producto card */
.product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-image {
    height: 200px;
    object-fit: cover;
    background-color: #f8f9fa;
}

.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-green);
}

.product-original-price {
    text-decoration: line-through;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Carrito de compras */
.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-right: 1rem;
}

.cart-item-details {
    flex: 1;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.quantity-btn:hover {
    background-color: var(--dark-green);
}

.quantity-display {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
}

/* Timeline */
.timeline {
    position: relative;
    padding: 1rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 2rem;
}

.timeline-marker {
    position: absolute;
    left: 22px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.timeline-content {
    background-color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* Progress steps */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.progress-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.progress-step::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    right: -50%;
    height: 2px;
    background-color: var(--border-color);
    z-index: -1;
}

.progress-step:last-child::before {
    display: none;
}

.progress-step.active .step-circle {
    background-color: var(--primary-color);
    color: white;
}

.progress-step.completed .step-circle {
    background-color: var(--dark-green);
    color: white;
}

.progress-step.completed::before {
    background-color: var(--dark-green);
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--border-color);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.step-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.progress-step.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Quick actions */
.quick-action {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--box-shadow);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.quick-action:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.quick-action-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.quick-action-title {
    font-weight: 600;
    color: var(--dark-green);
    margin-bottom: 0.5rem;
}

.quick-action-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
}
